--- /dev/null
+# CQL queries for testing.
+# from http://www.loc.gov/z3950/agency/zing/cql/sample-queries.html
+# Simple Term
+
+# Index Relation Term
+@attr 1=date @attr 2=1 1980
+@attr 1=date @attr 2=2 1980
+@attr 1=date @attr 2=3 1980
+@attr 1=date @attr 2=4 1980
+@attr 1=date @attr 2=5 1980
+@attr 1=date @attr 2=6 1980
+@attr 1=date @attr 2=x 1980
+
+# Truncation
+x
+@attr 5=100 x
+@attr 5=1 x
+@attr 5=2 x
+@attr 5=3 x
+@attr 5=other x
\ No newline at end of file
--- /dev/null
+#!/bin/sh
+srcdir=${srcdir:-.}
+oIFS="$IFS"
+IFS='
+'
+secno=0
+testno=0
+comment=0
+ecode=0
+test -f ${srcdir}/pqf2cqlsample || exit 1
+test -d pqf2cql || mkdir pqf2cql
+for f in `cat ${srcdir}/pqf2cqlsample`; do
+ if echo $f | grep '^#' >/dev/null; then
+ comment=1
+ else
+ if test "$comment" = "1"; then
+ secno=`expr $secno + 1`
+ testno=0
+ fi
+ comment=0
+ testno=`expr $testno + 1`
+ OUT1=${srcdir}/pqf2cql/$secno.$testno.out
+ ERR1=${srcdir}/pqf2cql/$secno.$testno.err
+ OUT2=pqf2cql/$secno.$testno.out.tmp
+ ERR2=pqf2cql/$secno.$testno.err.tmp
+ DIFF=pqf2cql/$secno.$testno.diff
+ ../util/cql2pqf -r - "$f" >$OUT2 2>$ERR2
+ if test -f $OUT1 -a -f $ERR1; then
+ if diff $OUT1 $OUT2 >$DIFF; then
+ rm $DIFF
+ rm $OUT2
+ else
+ echo "diff out $secno $testno $f"
+ cat $DIFF
+ ecode=1
+ fi
+ if diff $ERR1 $ERR2 >$DIFF; then
+ rm $DIFF
+ rm $ERR2
+ else
+ echo "diff err $secno $testno $f"
+ cat $DIFF
+ ecode=1
+ fi
+ else
+ echo "making test $secno $testno $f"
+ mv $OUT2 $OUT1
+ mv $ERR2 $ERR1
+ ecode=1
+ fi
+ fi
+done
+IFS="$oIFS"
+exit $ecode