@@ -32,21 +32,21 @@ public class StandardTests
3232 private static readonly string [ ] Toml11ValidButTomlTestMarksInvalid =
3333 [
3434 // TOML v1.1.0 additions (toml-test suite still marks them invalid).
35- @"\ invalid\ datetime\ no-secs.toml", // minute-only times
36- @"\ invalid\ local-datetime\ no-secs.toml",
37- @"\ invalid\ local-time\ no-secs.toml",
38- @"\ invalid\ string\ basic-byte-escapes.toml", // \xHH basic string escape
39- @"\ invalid\ inline-table\ trailing-comma.toml", // trailing commas in inline tables
40- @"\ invalid\ inline-table\ linebreak-01.toml", // TOML 1.1 allows newlines in inline tables
41- @"\ invalid\ inline-table\ linebreak-02.toml",
42- @"\ invalid\ inline-table\ linebreak-03.toml",
43- @"\ invalid\ inline-table\ linebreak-04.toml",
35+ "/ invalid/ datetime/ no-secs.toml", // minute-only times
36+ "/ invalid/ local-datetime/ no-secs.toml",
37+ "/ invalid/ local-time/ no-secs.toml",
38+ "/ invalid/ string/ basic-byte-escapes.toml", // \xHH basic string escape
39+ "/ invalid/ inline-table/ trailing-comma.toml", // trailing commas in inline tables
40+ "/ invalid/ inline-table/ linebreak-01.toml", // TOML 1.1 allows newlines in inline tables
41+ "/ invalid/ inline-table/ linebreak-02.toml",
42+ "/ invalid/ inline-table/ linebreak-03.toml",
43+ "/ invalid/ inline-table/ linebreak-04.toml",
4444 ] ;
4545
4646 private static readonly string [ ] Toml10SpecFolders =
4747 [
48- @"\ valid\ spec-1.0.0\ ",
49- @"\ invalid\ spec-1.0.0\ ",
48+ "/ valid/ spec-1.0.0/ ",
49+ "/ invalid/ spec-1.0.0/ ",
5050 ] ;
5151
5252 [ TestCaseSource ( "ListTomlFiles" , new object [ ] { ValidSpec } , Category = "toml-test" ) ]
@@ -199,9 +199,11 @@ public static IEnumerable ListTomlFiles(string type)
199199 var tests = new List < TestCaseData > ( ) ;
200200 foreach ( var file in Directory . EnumerateFiles ( directory , "*.toml" , SearchOption . AllDirectories ) )
201201 {
202+ var normalizedFile = file . Replace ( '\\ ' , '/' ) ;
203+
202204 for ( var i = 0 ; i < Toml10SpecFolders . Length ; i ++ )
203205 {
204- if ( file . IndexOf ( Toml10SpecFolders [ i ] , StringComparison . OrdinalIgnoreCase ) >= 0 )
206+ if ( normalizedFile . IndexOf ( Toml10SpecFolders [ i ] , StringComparison . OrdinalIgnoreCase ) >= 0 )
205207 {
206208 goto next_file ;
207209 }
@@ -211,7 +213,7 @@ public static IEnumerable ListTomlFiles(string type)
211213 {
212214 for ( var i = 0 ; i < Toml11ValidButTomlTestMarksInvalid . Length ; i ++ )
213215 {
214- if ( file . EndsWith ( Toml11ValidButTomlTestMarksInvalid [ i ] , StringComparison . OrdinalIgnoreCase ) )
216+ if ( normalizedFile . EndsWith ( Toml11ValidButTomlTestMarksInvalid [ i ] , StringComparison . OrdinalIgnoreCase ) )
215217 {
216218 goto next_file ;
217219 }
0 commit comments