- int i;
- for (i = 0; comp_strings[i].s1; i++)
- {
- int got = yaz_matchstr(comp_strings[i].s1,comp_strings[i].s2);
- if (got > 0)
- got = 1;
- else if (got < 0)
- got = -1;
- if (got != comp_strings[i].res)
- {
- printf ("tststr %d got=%d res=%d\n", i,
- got, comp_strings[i].res);
- exit(1);
- }
- }
- exit(0);
+ YAZ_CHECK_INIT(argc, argv);
+
+ YAZ_CHECK(yaz_matchstr("x", "x") == 0);
+ YAZ_CHECK(yaz_matchstr("x", "X") == 0);
+ YAZ_CHECK(yaz_matchstr("a", "b") > 0);
+ YAZ_CHECK(yaz_matchstr("b", "a") > 0);
+ YAZ_CHECK(yaz_matchstr("aa","a") > 0);
+ YAZ_CHECK(yaz_matchstr("a-", "a") > 0);
+ YAZ_CHECK(yaz_matchstr("A-b", "ab") == 0);
+ YAZ_CHECK(yaz_matchstr("A--b", "ab") > 0);
+ YAZ_CHECK(yaz_matchstr("A--b", "a-b") > 0);
+ YAZ_CHECK(yaz_matchstr("A--b", "a--b") == 0);
+ YAZ_CHECK(yaz_matchstr("a123", "a?") == 0);
+ YAZ_CHECK(yaz_matchstr("a123", "a1.3") == 0);
+ YAZ_CHECK(yaz_matchstr("a123", "..?") == 0);
+ YAZ_CHECK(yaz_matchstr("a123", "a1.") > 0);
+ YAZ_CHECK(yaz_matchstr("a123", "a...") == 0);
+
+ YAZ_CHECK_TERM;