dazinator / DotNet.Glob

A fast globbing library for .NET / .NETStandard applications. Outperforms Regex.
MIT License
363 stars 27 forks source link

"C:\THIS_IS_A_DIR\**\somefile.txt" matches wrongly to "C:\THIS_IS_A_DIR\awesomefile.txt" #27

Closed thomas-patzig closed 7 years ago

thomas-patzig commented 7 years ago

see the test "DotNet.Glob.Tests.GlobTests.Does_Not_Match" should not match but does it

[Theory]
[InlineData( "C:\\THIS_IS_A_DIR\\**\\somefile.txt", "C:\\THIS_IS_A_DIR\\awesomefile.txt" )]
public void Does_Not_Match(string pattern, params string[] testStrings)
{
    var glob = Globbing.Glob.Parse(pattern);
    foreach (var testString in testStrings)
    {
        Assert.False(glob.IsMatch(testString));
    }
}
dazinator commented 7 years ago

Ah yes, thank you for finding this bug with the behavior of **. I'll get it fixed and leave those tests in as regression tests for the future.

dazinator commented 7 years ago

This has now been fixed in the latest stable release, nuget package version 1.6.1.

czjlorenz commented 7 years ago

thank you very much for the quick fix

dazinator commented 7 years ago

You are welcome!