charconv.tcl does not like multi-line comments
[yaz-moved-to-github.git] / test / tstmatchstr.c
1 /* This file is part of the YAZ toolkit.
2  * Copyright (C) 1995-2008 Index Data
3  * See the file LICENSE for details.
4  */
5
6 #include <stdio.h>
7 #include <stdlib.h>
8
9 #include <yaz/matchstr.h>
10 #include <yaz/test.h>
11
12 int main (int argc, char **argv)
13 {
14     YAZ_CHECK_INIT(argc, argv);
15
16     YAZ_CHECK(yaz_matchstr("x", "x") == 0);
17     YAZ_CHECK(yaz_matchstr("x", "X") == 0);
18     YAZ_CHECK(yaz_matchstr("a", "b") > 0);
19     YAZ_CHECK(yaz_matchstr("b", "a") > 0);
20     YAZ_CHECK(yaz_matchstr("aa","a") > 0);
21     YAZ_CHECK(yaz_matchstr("a-", "a") > 0);
22     YAZ_CHECK(yaz_matchstr("A-b", "ab") == 0);
23     YAZ_CHECK(yaz_matchstr("A--b", "ab") > 0);
24     YAZ_CHECK(yaz_matchstr("A--b", "a-b") > 0);
25     YAZ_CHECK(yaz_matchstr("A--b", "a--b") == 0);
26     YAZ_CHECK(yaz_matchstr("a123",  "a?") == 0);
27     YAZ_CHECK(yaz_matchstr("a123",   "a1.3") == 0);
28     YAZ_CHECK(yaz_matchstr("a123",   "..?") == 0);
29     YAZ_CHECK(yaz_matchstr("a123",   "a1.") > 0);
30     YAZ_CHECK(yaz_matchstr("a123",   "a...") == 0);
31
32     YAZ_CHECK_TERM;
33 }
34
35 /*
36  * Local variables:
37  * c-basic-offset: 4
38  * indent-tabs-mode: nil
39  * End:
40  * vim: shiftwidth=4 tabstop=8 expandtab
41  */
42