From: Heikki Levanto Date: Fri, 17 Dec 2004 11:25:33 +0000 (+0000) Subject: Added a better test for attributes X-Git-Tag: ZEBRA.1.3.20~20 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=a7c03ab15240304e6d349af9f1ef16e65cf8e2e6;p=idzebra-moved-to-github.git Added a better test for attributes --- diff --git a/test/xpath/rec5.xml b/test/xpath/rec5.xml index 57eea27..f1ab4f5 100644 --- a/test/xpath/rec5.xml +++ b/test/xpath/rec5.xml @@ -24,3 +24,8 @@ foo bar grunt + + Danish Title + English Title + + diff --git a/test/xpath/test5.sh b/test/xpath/test5.sh index bbf067c..99799e1 100755 --- a/test/xpath/test5.sh +++ b/test/xpath/test5.sh @@ -1,11 +1,13 @@ #!/bin/sh -# $Id: test5.sh,v 1.3 2004-06-15 09:43:34 adam Exp $ +# $Id: test5.sh,v 1.3.2.1 2004-12-17 11:25:33 heikki Exp $ pp=${srcdir:-"."} LOG="test5.log" TMP="test5.tmp" -DBG="-v 1647" +# DBG="-v 1647" +DBG="" + rm -f $LOG rm -f $TMP.* ../../index/zebraidx -c $pp/zebra.cfg -l $LOG init || exit 1 @@ -26,6 +28,11 @@ test -f zebrasrv.pid || exit 2 ../api/testclient unix:socket "@attr 1=/record/value bar" >$TMP.6 ../api/testclient unix:socket "@and @attr 1=/record/title foo @attr 1=/record/title grunt" >$TMP.7 +../api/testclient unix:socket "@attr {1=/record/title[@lang='en']} English" >$TMP.8 +../api/testclient unix:socket "@attr {1=/record/title[@lang='en']} Danish" >$TMP.9 +../api/testclient unix:socket "@attr {1=/record/title[@lang='da']} English" >$TMP.10 +../api/testclient unix:socket "@attr {1=/record/title[@lang='da']} Danish" >$TMP.11 + echo 'Killing server' >>$LOG kill `cat zebrasrv.pid` || exit 3 sleep 1 @@ -42,9 +49,17 @@ grep "^Result count: 1$" $TMP.4 >/dev/null || exit 7 echo 'Checking that result count is 2' >>$LOG grep "^Result count: 2$" $TMP.5 >/dev/null || exit 8 echo 'Checking that result count is 1' >>$LOG -grep "^Result count: 1$" $TMP.6 >/dev/null || exit 8 +grep "^Result count: 1$" $TMP.6 >/dev/null || exit 9 +echo 'Checking that result count is 1' >>$LOG +grep "^Result count: 1$" $TMP.7 >/dev/null || exit 10 +echo 'Checking that result count is 1' >>$LOG +grep "^Result count: 1$" $TMP.8 >/dev/null || exit 11 +echo 'Checking that result count is 0' >>$LOG +grep "^Result count: 0$" $TMP.9 >/dev/null || exit 12 +echo 'Checking that result count is 0' >>$LOG +grep "^Result count: 0$" $TMP.10 >/dev/null || exit 13 echo 'Checking that result count is 1' >>$LOG -grep "^Result count: 1$" $TMP.7 >/dev/null || exit 8 +grep "^Result count: 1$" $TMP.11 >/dev/null || exit 14 echo 'Test OK' >>$LOG exit 0