unit_test.c 394 B

12345678910111213
  1. #include "mongoose.c"
  2. int main(void) {
  3. assert(match_prefix("/a/", 3, "/a/b/c") == 3);
  4. assert(match_prefix("/a/", 3, "/ab/c") == 0);
  5. assert(match_prefix("/*/", 3, "/ab/c") == 4);
  6. assert(match_prefix("**", 2, "/a/b/c") == 6);
  7. assert(match_prefix("/*", 2, "/a/b/c") == 2);
  8. assert(match_prefix("*/*", 3, "/a/b/c") == 2);
  9. assert(match_prefix("**/", 3, "/a/b/c") == 5);
  10. return 0;
  11. }