From: Daniel Carl Date: Sat, 6 Sep 2014 10:40:11 +0000 (+0200) Subject: Added more test cases for multiple * and ? in pattern. X-Git-Url: https://git.owens.tech/assets/favicon.png/assets/favicon.png/git?a=commitdiff_plain;h=6e884f6a7b0c42027eb043e6a353ab8616f41cc6;p=vimb.git Added more test cases for multiple * and ? in pattern. --- diff --git a/tests/test-util.c b/tests/test-util.c index cd80420..a8d42f7 100644 --- a/tests/test-util.c +++ b/tests/test-util.c @@ -169,6 +169,7 @@ static void test_wildmatch_questionmark(void) g_assert_false(util_wildmatch("foo\\?bar", "foorbar")); g_assert_false(util_wildmatch("?", "")); + g_assert_false(util_wildmatch("b??r", "bar")); } static void test_wildmatch_wildcard(void) @@ -181,8 +182,13 @@ static void test_wildmatch_wildcard(void) g_assert_true(util_wildmatch("match\\*", "match*")); g_assert_true(util_wildmatch("do * match", "do a infix match")); g_assert_true(util_wildmatch("*://*.io/*", "http://fanglingsu.github.io/vimb/")); + /* multiple * should act like a single one */ + g_assert_true(util_wildmatch("**", "")); + g_assert_true(util_wildmatch("match **", "Match as much as possible")); + g_assert_true(util_wildmatch("f***u", "fu")); g_assert_false(util_wildmatch("match\\*", "match fail")); + g_assert_false(util_wildmatch("f***u", "full")); } int main(int argc, char *argv[])