fix bug in GlobUtil

This commit is contained in:
Sebastian Sdorra
2011-10-19 08:12:29 +02:00
parent 9556726093
commit 061483d56a
2 changed files with 8 additions and 8 deletions

View File

@@ -190,6 +190,6 @@ public class GlobUtil
*/ */
public static boolean matches(String glob, String value) public static boolean matches(String glob, String value)
{ {
return value.matches(convertGlobToRegEx(value)); return value.matches(convertGlobToRegEx(glob));
} }
} }

View File

@@ -66,11 +66,11 @@ public class GlobUtilTest
@Test @Test
public void matchesTest() public void matchesTest()
{ {
assertTrue(GlobUtil.matches("/test/path/somefile.txt", "/test/path/*")); assertTrue(GlobUtil.matches("/test/path/*", "/test/path/somefile.txt"));
assertTrue(GlobUtil.matches("/test/path/somefile.txt", "*/somefile.txt")); assertTrue(GlobUtil.matches("*/somefile.txt", "/test/path/somefile.txt"));
assertTrue(GlobUtil.matches("asd", "a*d")); assertTrue(GlobUtil.matches("a*d", "asd"));
assertTrue(GlobUtil.matches("asd", "a?d")); assertTrue(GlobUtil.matches("a?d", "asd"));
assertFalse(GlobUtil.matches("asd", "a\\*d")); assertFalse(GlobUtil.matches("a\\*d", "asd"));
assertFalse(GlobUtil.matches("asd", "a\\?d")); assertFalse(GlobUtil.matches("a\\?d", "asd"));
} }
} }