@@ -83,6 +83,15 @@ public void ListContentsWithSpaces()
8383 [ Fact ]
8484 public void ListContentsLongPath ( )
8585 {
86+ //NOTE: windows is terrible with a path this long so even git won't allow committing a file with a path this long on windows. So we create it here:
87+ Path initTestFile = GetTestPath ( @"long-path\long-directory-name\very\unusually\long\directory\name\with\cream\sugar\and\chocolate\topping\long-directory-name\very\unusually\long\directory\name\with\cream\sugar\and\chocolate\toppinglong-directory-name\very\unusually\long\directory\name\with\cream\sugar\and\chocolate\topping\test.txt" ) ;
88+ if ( ! FileSystem . Exists ( initTestFile ) )
89+ {
90+ FileSystem . CreateDirectory ( initTestFile . Parent ) ;
91+ FileSystem . Copy ( GetTestPath ( @"test.txt" ) , initTestFile ) ;
92+ }
93+
94+ //NOW onto the test...
8695 Path p = GetTestPath ( @"long-path\long-directory-name\very\unusually\long\directory\name\with\cream\sugar\and\chocolate\topping\long-directory-name\very\unusually\long\directory\name\with\cream\sugar\and\chocolate\toppinglong-directory-name\very\unusually\long\directory\name\with\cream\sugar\and\chocolate\topping\" ) ;
8796 var actual = FileSystem . ListContents ( p ) . ToArray ( ) ;
8897 var expected = new Path [ ]
@@ -93,14 +102,14 @@ public void ListContentsLongPath()
93102 }
94103
95104 [ Fact ]
96- public void ListContentsLevelsWithoutFiles ( )
105+ public void ListContentsAllLevelsWithoutFiles ( )
97106 {
98- Path p = GetTestPath ( @"levelsWithoutFiles " ) ;
107+ Path p = GetTestPath ( @"allLevelsWithoutFiles " ) ;
99108 var actual = FileSystem . ListContents ( p , true ) . ToArray ( ) ;
100109 var expected = new Path [ ]
101110 {
102- GetTestPath ( @"levelsWithoutFiles \secondLevel" ) ,
103- GetTestPath ( @"levelsWithoutFiles \secondLevel\thirdLevel" ) ,
111+ GetTestPath ( @"allLevelsWithoutFiles \secondLevel" ) ,
112+ GetTestPath ( @"allLevelsWithoutFiles \secondLevel\thirdLevel" ) ,
104113 } ;
105114 Assert . Equal ( expected , actual ) ;
106115 }
@@ -178,7 +187,7 @@ private void SubstDrive(bool remove)
178187 Debug . Assert ( started ) ;
179188 subst . WaitForExit ( ) ;
180189 Debug . Print ( "Subst output:" ) ;
181-
190+ //because -1 means' already substed??
182191 if ( 0 != subst . ExitCode )
183192 {
184193 var stderr = subst . StandardError . ReadToEnd ( ) ;
0 commit comments