@@ -19,6 +19,7 @@ public class GlobTests
19
19
[ InlineData ( "literal" , "fliteral" , "foo/literal" , "literals" , "literals/foo" ) ]
20
20
[ InlineData ( "path/hats*nd" , "path/hatsblahn" , "path/hatsblahndt" ) ]
21
21
[ InlineData ( "path/?atstand" , "path/moatstand" , "path/batstands" ) ]
22
+ [ InlineData ( "/**/file.csv" , "/file.txt" ) ]
22
23
public void Does_Not_Match ( string pattern , params string [ ] testStrings )
23
24
{
24
25
var glob = Glob . Parse ( pattern ) ;
@@ -45,6 +46,10 @@ public void Does_Not_Match(string pattern, params string[] testStrings)
45
46
[ InlineData ( "p?th/*a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].*" , "pAth/fooooacbfa2vd4.txt" ) ]
46
47
[ InlineData ( "path/**/somefile.txt" , "path/foo/bar/baz/somefile.txt" ) ]
47
48
[ InlineData ( "p?th/*a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].*" , "pGth/yGKNY6acbea3rm8." ) ]
49
+ [ InlineData ( "/**/file.*" , "/folder/file.csv" ) ]
50
+ [ InlineData ( "/**/file.*" , "/file.txt" ) ]
51
+ [ InlineData ( "/**/file.*" , "/file.txt" ) ]
52
+ [ InlineData ( "**/file.*" , "/file.txt" ) ]
48
53
public void Can_IsMatch ( string pattern , params string [ ] testStrings )
49
54
{
50
55
var glob = Glob . Parse ( pattern ) ;
@@ -61,7 +66,7 @@ public void Can_IsMatch(string pattern, params string[] testStrings)
61
66
[ Fact ]
62
67
public void To_String_Returns_Pattern ( )
63
68
{
64
- var pattern = "p?th/*a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].*" ;
69
+ var pattern = "p?th/*a[bcd]b[e-g]/**/ a[1-4][!wxyz][!a-c][!1-3].*" ;
65
70
var glob = Glob . Parse ( pattern ) ;
66
71
var resultPattern = glob . ToString ( ) ;
67
72
Assert . Equal ( pattern , resultPattern ) ;
@@ -72,6 +77,7 @@ public void To_String_Returns_Pattern()
72
77
/// <summary>
73
78
/// Tests for the InMemoryDirectory sub system.
74
79
/// </summary>
80
+ /// <Remarks>These tests are for another library that I am using to compare againts.</Remarks>
75
81
[ Theory ]
76
82
[ InlineData ( "literal" , "literal" ) ]
77
83
[ InlineData ( "a/literal" , "a/literal" ) ]
@@ -85,8 +91,14 @@ public void To_String_Returns_Pattern()
85
91
[ InlineData ( "p?th/*a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].*" , "pAth/fooooacbfa2vd4.txt" ) ]
86
92
[ InlineData ( "path/**/somefile.txt" , "path/foo/bar/baz/somefile.txt" ) ]
87
93
[ InlineData ( "p?th/*a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].*" , "pGth/yGKNY6acbea3rm8." ) ]
94
+ [ InlineData ( "/**/file.*" , "/folder/file.csv" ) ]
95
+ //[InlineData("/**/file.*", "/file.txt")]
96
+ //[InlineData("**/file.*", "/file.txt")]
97
+ //[InlineData("/**/file.*", "/file.txt")]
88
98
public void Glob_IsMatch ( string pattern , params string [ ] testStrings )
89
99
{
100
+ // This is a different glob library, I am seeing if it matches the same patterns as my library.
101
+ // The three tests above commented out show it currently has some limitations, that this library doesn't.
90
102
var glob = new global ::Glob . Glob ( pattern ) ;
91
103
foreach ( var testString in testStrings )
92
104
{
0 commit comments