1 /* This file is part of the Zebra server.
2 Copyright (C) 1994-2009 Index Data
4 Zebra is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
9 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #include "../api/testlib.h"
22 static void tst(int argc, char **argv)
24 ZebraService zs = tl_start_up(0, argc, argv);
25 ZebraHandle zh = zebra_open(zs, 0);
28 tl_check_filter(zs, "grs.xml");
30 YAZ_CHECK(zebra_select_database(zh, "Default") == ZEBRA_OK);
34 YAZ_CHECK(zebra_begin_trans(zh, 1) == ZEBRA_OK);
36 sprintf(path, "%.200s/x.xml", tl_get_srcdir());
37 zebra_repository_update(zh, path);
38 YAZ_CHECK(zebra_end_trans(zh) == ZEBRA_OK);
41 YAZ_CHECK(tl_query(zh, "@attr 1=4 @term string æ", 1));
43 /* search for UNICODE 1E25 - letter h with dot below */
44 YAZ_CHECK(tl_query(zh, "@attr 1=4 @term string ḥ", 1));
46 /* search for UNICODE A ring */
47 YAZ_CHECK(tl_query(zh, "@attr 1=4 @term string lås", 1));
50 YAZ_CHECK(tl_query(zh, "@attr 1=4 @term string laas", 1));
52 /* search for aa regular-1 */
53 YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 5=102 @term string lås", 1));
55 /* search for aa regular-2 */
56 YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 5=103 @term string lås", 1));
58 /* search for aa trunc=104 */
59 YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 5=104 @term string laas", 1));
61 /* search for aa trunc=105 */
62 YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 5=104 @term string laas", 1));
65 YAZ_CHECK(tl_query(zh, "@attr 1=4 @term string laaas", 0));
67 /* search ABC in title:0 . */
68 YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 4=3 @attr 1=4 ABC", 1));
70 /* search DEF in title:0 . */
71 YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 4=3 @attr 1=4 DEF", 0));
73 /* search [ in title:0 . */
74 YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 4=3 @attr 1=4 [", 1));
76 /* search \ in title:0 . */
77 YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 4=3 @attr 1=4 \\\\\\\\", 1));
79 /* search { in title:0 . */
80 YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 4=3 @attr 1=4 \\{", 1));
82 YAZ_CHECK(tl_close_down(zh, zs));
89 * indent-tabs-mode: nil
91 * vim: shiftwidth=4 tabstop=8 expandtab