소스 검색

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);