瀏覽代碼

few more tests for match_prefix()

Sergey Lyubka 13 年之前
父節點
當前提交
d1806370bd
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      test/unit_test.c

+ 2 - 0
test/unit_test.c

@@ -21,6 +21,8 @@ static void test_match_prefix(void) {
   assert(match_prefix("$", 1, "x") == -1);
   assert(match_prefix("*$", 2, "x") == 1);
   assert(match_prefix("/$", 2, "/") == 1);
+  assert(match_prefix("**/$", 4, "/a/b/c") == -1);
+  assert(match_prefix("**/$", 4, "/a/b/") == 5);
   assert(match_prefix("*", 1, "/hello/") == 0);
   assert(match_prefix("**.a$|**.b$", 11, "/a/b.b/") == -1);
   assert(match_prefix("**.a$|**.b$", 11, "/a/b.b") == 6);