projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Missing quote
[yaz-moved-to-github.git]
/
test
/
tstccl.c
diff --git
a/test/tstccl.c
b/test/tstccl.c
index
37cf0c9
..
c816601
100644
(file)
--- a/
test/tstccl.c
+++ b/
test/tstccl.c
@@
-1,12
+1,13
@@
/*
/*
- * Copyright (c) 2002-2004, Index Data
+ * Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
* See the file LICENSE for details.
*
- * $Id: tstccl.c,v 1.4 2004-09-29 20:37:51 adam Exp $
+ * $Id: tstccl.c,v 1.8 2005-04-15 21:47:56 adam Exp $
*/
/* CCL test */
*/
/* CCL test */
+#include <stdlib.h>
#include <string.h>
#include <yaz/ccl.h>
#include <string.h>
#include <yaz/ccl.h>
@@
-36,6
+37,10
@@
static struct ccl_tst query_str[] = {
{ "x= -1980", "@attr 2=3 -1980 "},
{ "x=234-1990", "@attr 2=3 234-1990 "},
{ "x=234 - 1990", "@and @attr 2=4 234 @attr 2=2 1990 "},
{ "x= -1980", "@attr 2=3 -1980 "},
{ "x=234-1990", "@attr 2=3 234-1990 "},
{ "x=234 - 1990", "@and @attr 2=4 234 @attr 2=2 1990 "},
+ { "ti=a,b", "@attr 4=1 @attr 1=4 a,b "},
+ { "ti=a, b", "@attr 4=1 @attr 1=4 a,\\ b "},
+ { "ti=a-b", "@attr 4=2 @attr 1=4 a-b "},
+ { "ti=a - b", "@attr 4=1 @attr 1=4 a\\ -\\ b "},
{0, 0}
};
{0, 0}
};
@@
-88,9
+93,11
@@
void tst1(int pass, int *number_of_errors)
for (i = 0; query_str[i].query; i++)
{
for (i = 0; query_str[i].query; i++)
{
- struct ccl_token *token_list =
- ccl_parser_tokenize(parser, query_str[i].query);
- struct ccl_rpn_node *rpn = ccl_parser_find(parser, token_list);
+ struct ccl_token *token_list;
+ struct ccl_rpn_node *rpn;
+
+ token_list = ccl_parser_tokenize(parser, query_str[i].query);
+ rpn = ccl_parser_find(parser, token_list);
ccl_token_del (token_list);
if (rpn)
{
ccl_token_del (token_list);
if (rpn)
{
@@
-100,14
+107,14
@@
void tst1(int pass, int *number_of_errors)
if (!query_str[i].result)
{
printf ("Failed %s\n", query_str[i].query);
if (!query_str[i].result)
{
printf ("Failed %s\n", query_str[i].query);
- printf (" got:%s:\n", wrbuf_buf(wrbuf));
+ printf (" got: %s:\n", wrbuf_buf(wrbuf));
printf (" expected failure\n");
(*number_of_errors)++;
}
else if (strcmp(wrbuf_buf(wrbuf), query_str[i].result))
{
printf ("Failed %s\n", query_str[i].query);
printf (" expected failure\n");
(*number_of_errors)++;
}
else if (strcmp(wrbuf_buf(wrbuf), query_str[i].result))
{
printf ("Failed %s\n", query_str[i].query);
- printf (" got:%s:\n", wrbuf_buf(wrbuf));
+ printf (" got: %s:\n", wrbuf_buf(wrbuf));
printf (" expected:%s:\n", query_str[i].result);
(*number_of_errors)++;
}
printf (" expected:%s:\n", query_str[i].result);
(*number_of_errors)++;
}