@@ -59,6 +59,17 @@ public async Task GivenASourceInstallSucceeds()
59
59
packagePath . Should ( ) . Contain ( _tempDirectory . Value , "Package should be downloaded to the input folder" ) ;
60
60
}
61
61
62
+ [ Fact ]
63
+ public async Task GivenSourceWithLeadingWhitespaceInstallSucceeds ( )
64
+ {
65
+ string packagePath = await _installer . DownloadPackageAsync (
66
+ TestPackageId ,
67
+ new NuGetVersion ( TestPackageVersion ) ,
68
+ new PackageSourceLocation ( sourceFeedOverrides : new [ ] { " " + GetTestLocalFeedPath ( ) } ) ) ; // Leading space
69
+ File . Exists ( packagePath ) . Should ( ) . BeTrue ( ) ;
70
+ packagePath . Should ( ) . Contain ( _tempDirectory . Value , "Package should be downloaded to the input folder" ) ;
71
+ }
72
+
62
73
[ Fact ]
63
74
public async Task GivenAFailedSourceItShouldError ( )
64
75
{
@@ -228,6 +239,19 @@ public async Task WhenPassedIncludePreviewItInstallSucceeds()
228
239
"Package should download higher package version" ) ;
229
240
}
230
241
242
+ [ Fact ]
243
+ public async Task GivenAdditionalSourceWithLeadingWhitespaceInstallSucceeds ( )
244
+ {
245
+ string getTestLocalFeedPath = GetTestLocalFeedPath ( ) ;
246
+ string relativePath = Path . GetRelativePath ( Environment . CurrentDirectory , getTestLocalFeedPath ) ;
247
+ string packagePath = await _installer . DownloadPackageAsync (
248
+ TestPackageId ,
249
+ new NuGetVersion ( TestPackageVersion ) ,
250
+ new PackageSourceLocation ( additionalSourceFeeds : new [ ] { " " + relativePath } ) ) ; // Leading space
251
+ File . Exists ( packagePath ) . Should ( ) . BeTrue ( ) ;
252
+ packagePath . Should ( ) . Contain ( _tempDirectory . Value , "Package should be downloaded to the input folder" ) ;
253
+ }
254
+
231
255
[ WindowsOnlyFact ]
232
256
public async Task GivenANonSignedSdkItShouldPrintMessageOnce ( )
233
257
{
0 commit comments