Revert
[yaz-moved-to-github.git] / test / tstmatchstr.c
1 /*
2  * Copyright (C) 1995-2005, Index Data ApS
3  * See the file LICENSE for details.
4  *
5  * $Id: tstmatchstr.c,v 1.5 2006-01-29 21:59:13 adam Exp $
6  */
7
8 #include <stdio.h>
9 #include <stdlib.h>
10
11 #include <yaz/yaz-iconv.h>
12 #include <yaz/test.h>
13
14 int main (int argc, char **argv)
15 {
16     YAZ_CHECK_INIT(argc, argv);
17
18     YAZ_CHECK(yaz_matchstr("x", "x") == 0);
19     YAZ_CHECK(yaz_matchstr("x", "X") == 0);
20     YAZ_CHECK(yaz_matchstr("a", "b") > 0);
21     YAZ_CHECK(yaz_matchstr("b", "a") > 0);
22     YAZ_CHECK(yaz_matchstr("aa","a") > 0);
23     YAZ_CHECK(yaz_matchstr("a-", "a") > 0);
24     YAZ_CHECK(yaz_matchstr("A-b", "ab") == 0);
25     YAZ_CHECK(yaz_matchstr("A--b", "ab") > 0);
26     YAZ_CHECK(yaz_matchstr("A--b", "a-b") > 0);
27     YAZ_CHECK(yaz_matchstr("A--b", "a--b") == 0);
28     YAZ_CHECK(yaz_matchstr("a123",  "a?") == 0);
29     YAZ_CHECK(yaz_matchstr("a123",   "a1.3") == 0);
30     YAZ_CHECK(yaz_matchstr("a123",   "..?") == 0);
31     YAZ_CHECK(yaz_matchstr("a123",   "a1.") > 0);
32     YAZ_CHECK(yaz_matchstr("a123",   "a...") == 0);
33
34     YAZ_CHECK_TERM;
35 }
36
37 /*
38  * Local variables:
39  * c-basic-offset: 4
40  * indent-tabs-mode: nil
41  * End:
42  * vim: shiftwidth=4 tabstop=8 expandtab
43  */
44