File tree Expand file tree Collapse file tree
Scalar.FunctionalTests/Tests/EnlistmentPerFixture Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,6 +106,24 @@ public void CloneToPathWithSpaces()
106106 enlistment . UnmountAndDeleteAll ( ) ;
107107 }
108108
109+ [ TestCase ]
110+ public void CloneCreatesCorrectFilesInRoot ( )
111+ {
112+ ScalarFunctionalTestEnlistment enlistment = ScalarFunctionalTestEnlistment . CloneAndMount ( ScalarTestConfig . PathToScalar ) ;
113+ try
114+ {
115+ Directory . GetFiles ( enlistment . EnlistmentRoot ) . ShouldBeEmpty ( "There should be no files in the enlistment root after cloning" ) ;
116+ string [ ] directories = Directory . GetDirectories ( enlistment . EnlistmentRoot ) ;
117+ directories . Length . ShouldEqual ( 2 ) ;
118+ directories . ShouldContain ( x => Path . GetFileName ( x ) . Equals ( ".scalar" , StringComparison . Ordinal ) ) ;
119+ directories . ShouldContain ( x => Path . GetFileName ( x ) . Equals ( "src" , StringComparison . Ordinal ) ) ;
120+ }
121+ finally
122+ {
123+ enlistment . UnmountAndDeleteAll ( ) ;
124+ }
125+ }
126+
109127 private void SubfolderCloneShouldFail ( )
110128 {
111129 ProcessStartInfo processInfo = new ProcessStartInfo ( ScalarTestConfig . PathToScalar ) ;
Original file line number Diff line number Diff line change @@ -27,20 +27,20 @@ public override bool IsSocket(string fileName)
2727
2828 public override bool IsFileSystemSupported ( string path , out string error )
2929 {
30- string lowerCaseFile = Guid . NewGuid ( ) . ToString ( ) . ToLower ( ) ;
31- string upperCaseFile = lowerCaseFile . ToUpper ( ) ;
3230 error = null ;
33-
3431 try
3532 {
36- File . Create ( Path . Combine ( path , lowerCaseFile ) ) ;
37- if ( File . Exists ( Path . Combine ( path , upperCaseFile ) ) )
33+ string lowerCaseFilePath = Path . Combine ( path , $ "casetest{ Guid . NewGuid ( ) . ToString ( ) } ") ;
34+ string upperCaseFilePath = lowerCaseFilePath . ToUpper ( ) ;
35+
36+ File . Create ( lowerCaseFilePath ) ;
37+ if ( File . Exists ( upperCaseFilePath ) )
3838 {
39- File . Delete ( lowerCaseFile ) ;
39+ File . Delete ( lowerCaseFilePath ) ;
4040 return true ;
4141 }
4242
43- File . Delete ( lowerCaseFile ) ;
43+ File . Delete ( lowerCaseFilePath ) ;
4444 error = "Scalar does not support case sensitive filesystems" ;
4545 return false ;
4646 }
You can’t perform that action at this time.
0 commit comments