From be52a8f9c260f7953bc8b6b991c476120d8704ad Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Mon, 11 Nov 2024 13:45:45 +0100 Subject: Fix comma globs --- src/test/java/com/notnite/gloppers/GlobUtilTest.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/test/java') diff --git a/src/test/java/com/notnite/gloppers/GlobUtilTest.java b/src/test/java/com/notnite/gloppers/GlobUtilTest.java index 064ced1..1ceed6a 100644 --- a/src/test/java/com/notnite/gloppers/GlobUtilTest.java +++ b/src/test/java/com/notnite/gloppers/GlobUtilTest.java @@ -5,6 +5,17 @@ import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; class GlobUtilTest { + @Test + public void multiGlobPattern() { + assertTrue(GlobUtil.matchGlobSequence("test", "test,foo")); + assertTrue(GlobUtil.matchGlobSequence("foo", "test,foo")); + assertTrue(GlobUtil.matchGlobSequence("foo", "foo")); + assertTrue(GlobUtil.matchGlobSequence("foo", "test,f*")); + assertTrue(GlobUtil.matchGlobSequence("foo", "*o,f*")); + assertFalse(GlobUtil.matchGlobSequence("baa", "*o,f*")); + } + + @Test public void testGlobBeginning() { assertTrue(GlobUtil.matchGlob("test_id", "*_id")); @@ -28,7 +39,7 @@ class GlobUtilTest { } @Test - public void testSinglePlaceholder() { + public void testSingleGlobPlaceholder() { assertTrue(GlobUtil.matchGlob("test_id", "tes?_i?")); } } -- cgit