"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "omegatest" between
xapian-omega-1.4.19.tar.xz and xapian-omega-1.4.20.tar.xz

About: Xapian Omega is an application built on Xapian, consisting of indexers and a CGI search frontend.

omegatest  (xapian-omega-1.4.19.tar.xz):omegatest  (xapian-omega-1.4.20.tar.xz)
#!/bin/sh #!/bin/sh
# omegatest: Test omega CGI # omegatest: Test omega CGI
# #
# Copyright (C) 2015,2016,2017,2018,2019,2020,2021 Olly Betts # Copyright (C) 2015-2022 Olly Betts
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as # modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the # published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version. # License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
skipping to change at line 56 skipping to change at line 56
OMEGA_CONFIG_FILE=test-omega.conf OMEGA_CONFIG_FILE=test-omega.conf
export OMEGA_CONFIG_FILE export OMEGA_CONFIG_FILE
cat > "$OMEGA_CONFIG_FILE" <<__END__ cat > "$OMEGA_CONFIG_FILE" <<__END__
database_dir . database_dir .
template_dir . template_dir .
log_dir tmplog log_dir tmplog
default_template $TEST_TEMPLATE default_template $TEST_TEMPLATE
default_db $TEST_DB default_db $TEST_DB
__END__ __END__
# Glob pattern matching scriptindex summary line.
SUMMARY_GLOB='records (added, replaced, deleted, skipped) = (*, *, *, *)'
failed=0 failed=0
testcase() { testcase() {
expected=$1 expected=$1
shift shift
# If there are no positional parameters, pass one as otherwise omega will # If there are no positional parameters, pass one as otherwise omega will
# wait for parameters on stdin. # wait for parameters on stdin.
[ "$#" != 0 ] || { set x dummy; shift; } [ "$#" != 0 ] || { set x dummy; shift; }
if [ -n "$FAKE_NOW" ] ; then if [ -n "$FAKE_NOW" ] ; then
skipping to change at line 89 skipping to change at line 92
failed=`expr $failed + 1` failed=`expr $failed + 1`
fi fi
} }
qtestcase() { qtestcase() {
expected="Query($1)" expected="Query($1)"
shift shift
testcase "$expected" "$@" testcase "$expected" "$@"
} }
# Test scriptindex gives expected error.
#
# Parameters:
# * what: text to report to describe situation
# * expect: expected glob pattern stdout+stderr should match
# * (optional) input: input to feed scriptindex; can contain \n, etc escapes
# (default: /dev/null)
#
# Uses database $TEST_DB and index script $TEST_INDEXSCRIPT.
test_scriptindex_error() {
what=$1
expect=$2
input=$3
rm -rf "$TEST_DB"
rc=0
case $input in
"")
out=`$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" < /dev/null 2>&1` || rc=$?
;;
*%*)
# Escape any % by doubling.
input=`printf '%s' "$input"|sed 's/%/%%/g'`
out=`printf "$input"|$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" 2>&1` || rc
=$?
;;
*)
out=`printf "$input"|$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" 2>&1` || rc
=$?
;;
esac
if [ $rc -eq 0 ] ; then
printf "scriptindex didn't exit with non-zero return code for %s"'\n' "$what
"
printf 'Output: %s\n' "$out"
failed=`expr $failed + 1`
else
case $out in
$expect) ;; # OK
*)
printf "scriptindex didn't give expected error for %s"'\n' "$what"
printf 'Expect: %s\n' "$expect"
printf 'Output: %s\n' "$out"
failed=`expr $failed + 1`
;;
esac
fi
}
# Test scriptindex gives expected warning.
#
# Parameters:
# * what: text to report to describe situation
# * expect: expected glob pattern stdout+stderr should match
# * (optional) input: input to feed scriptindex; can contain \n, etc escapes
# (default: /dev/null)
#
# Uses database $TEST_DB and index script $TEST_INDEXSCRIPT.
test_scriptindex_warning() {
what=$1
expect="$2
$SUMMARY_GLOB"
input=$3
rm -rf "$TEST_DB"
rc=0
case $input in
"")
out=`$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" < /dev/null 2>&1` || rc=$?
;;
*%*)
# Escape any % by doubling.
input=`printf '%s' "$input"|sed 's/%/%%/g'`
out=`printf "$input"|$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" 2>&1` || rc
=$?
;;
*)
out=`printf "$input"|$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" 2>&1` || rc
=$?
;;
esac
if [ $rc -ne 0 ] ; then
printf "scriptindex gave an error rather than the expected warning for %s"'\
n' "$what"
printf 'Output: %s\n' "$out"
failed=`expr $failed + 1`
else
case $out in
$expect) ;; # OK
*)
printf "scriptindex didn't give expected warning for %s"'\n' "$what"
printf 'Expect: %s\n' "$expect"
printf 'Output: %s\n' "$out"
failed=`expr $failed + 1`
;;
esac
fi
}
# Test scriptindex runs cleanly
#
# Parameters:
# * what: text to report to describe situation
# * (optional) input: input to feed scriptindex; can contain \n, etc escapes
# (default: /dev/null)
#
# Uses database $TEST_DB and index script $TEST_INDEXSCRIPT.
test_scriptindex() {
what=$1
input=$2
rm -rf "$TEST_DB"
rc=0
case $input in
"")
out=`$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" < /dev/null 2>&1` || rc=$?
;;
*%*)
# Escape any % by doubling.
input=`printf '%s' "$input"|sed 's/%/%%/g'`
out=`printf "$input"|$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" 2>&1` || rc
=$?
;;
*)
out=`printf "$input"|$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" 2>&1` || rc
=$?
;;
esac
if [ $rc -ne 0 ] ; then
printf 'scriptindex gave an error for %s\n' "$what"
printf 'Output: %s\n' "$out"
failed=`expr $failed + 1`
else
case $out in
$SUMMARY_GLOB) ;; # OK
*)
printf 'scriptindex gave unexpected output for %s\n' "$what"
printf 'Output: %s\n' "$out"
failed=`expr $failed + 1`
;;
esac
fi
}
unset FAKE_NOW unset FAKE_NOW
# Test a few simple things. # Test a few simple things.
qtestcase 'Zsimpl@1' P=simple qtestcase 'Zsimpl@1' P=simple
qtestcase '(chocolate@1 FILTER Tconfectionary/fudge)' P=Chocolate B=Tconfectiona ry/fudge qtestcase '(chocolate@1 FILTER Tconfectionary/fudge)' P=Chocolate B=Tconfectiona ry/fudge
# Test date value ranges. # Test date value ranges.
qtestcase 'VALUE_RANGE 0 2 ~' DATEVALUE=0 START=2000 qtestcase 'VALUE_RANGE 0 2 ~' DATEVALUE=0 START=2000
qtestcase 'VALUE_RANGE 0 2 ~' DATEVALUE=0 START=200001 qtestcase 'VALUE_RANGE 0 2 ~' DATEVALUE=0 START=200001
qtestcase 'VALUE_RANGE 0 2 ~' DATEVALUE=0 START=20000101 qtestcase 'VALUE_RANGE 0 2 ~' DATEVALUE=0 START=20000101
skipping to change at line 749 skipping to change at line 885
testcase '|' text='' testcase '|' text=''
testcase 'foo|foo' text='foo' testcase 'foo|foo' text='foo'
testcase 'apple:banana:cherry|apple:banana:cherry' text='apple apple banana bana na banana cherry' testcase 'apple:banana:cherry|apple:banana:cherry' text='apple apple banana bana na banana cherry'
testcase 'a:b:r:a:c:a:d:a:b:r:a|a:b:r:c:d' text='a b r a c a d a b r a' testcase 'a:b:r:a:c:a:d:a:b:r:a|a:b:r:c:d' text='a b r a c a d a b r a'
testcase 'x:y:z:y|x:y:z' text='x y z z y' testcase 'x:y:z:y|x:y:z' text='x y z z y'
# Regression test - $map with one argument wasn't rejected cleanly. # Regression test - $map with one argument wasn't rejected cleanly.
printf '$map{foo}' > "$TEST_TEMPLATE" printf '$map{foo}' > "$TEST_TEMPLATE"
testcase 'Exception: too few arguments to $map' testcase 'Exception: too few arguments to $map'
# Omit trailing \n on dump file as regression test for bug fixed in 1.4.20
# where a final line without a newline was ignored.
printf 'a b : index field' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB"
printf 'a=1\nb=2' | $SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null
printf '$record{1}' > "$TEST_TEMPLATE"
testcase 'a=1
b=2'
# Test MORELIKE CGI parameter. # Test MORELIKE CGI parameter.
printf '%s\n' 'id : boolean=Q' 'text : index field' > "$TEST_INDEXSCRIPT" printf '%s\n' 'id : boolean=Q' 'text : index field' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" rm -rf "$TEST_DB"
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END' $SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END'
id=a1 id=a1
text=First document text=First document
id=b2 id=b2
text=Second article text=Second article
skipping to change at line 787 skipping to change at line 932
# "of" is excluded because it's a stopword. # "of" is excluded because it's a stopword.
testcase 'Query((Zwrite@1 OR Zthree@2 OR Zpiec@3))|writing OR three OR piece' MO RELIKE='Qc3' testcase 'Query((Zwrite@1 OR Zthree@2 OR Zpiec@3))|writing OR three OR piece' MO RELIKE='Qc3'
# Test with absent term. # Test with absent term.
testcase 'Query()|' MORELIKE='Qx9' testcase 'Query()|' MORELIKE='Qx9'
# Test multiple MORELIKE parameters. We need to include the dummy document for # Test multiple MORELIKE parameters. We need to include the dummy document for
# any terms to get a positive weight and be returned. # any terms to get a positive weight and be returned.
testcase 'Query((Zsecond@1 OR Zfirst@2 OR Zdocument@3))|second OR first OR docum ent' MORELIKE=1 MORELIKE=2 MORELIKE=4 testcase 'Query((Zsecond@1 OR Zfirst@2 OR Zdocument@3))|second OR first OR docum ent' MORELIKE=1 MORELIKE=2 MORELIKE=4
testcase 'Query((Zsecond@1 OR Zfirst@2 OR Zdocument@3))|second OR first OR docum ent' MORELIKE=Qa1 MORELIKE=2 MORELIKE=4 testcase 'Query((Zsecond@1 OR Zfirst@2 OR Zdocument@3))|second OR first OR docum ent' MORELIKE=Qa1 MORELIKE=2 MORELIKE=4
testcase 'Query((Zsecond@1 OR Zfirst@2 OR Zdocument@3))|second OR first OR docum ent' MORELIKE=Qa1 MORELIKE=Qb2 MORELIKE=Qdummy testcase 'Query((Zsecond@1 OR Zfirst@2 OR Zdocument@3))|second OR first OR docum ent' MORELIKE=Qa1 MORELIKE=Qb2 MORELIKE=Qdummy
# Test errors for scriptindex input format issues.
printf 'f : index field' > "$TEST_INDEXSCRIPT"
test_scriptindex_error "no = in input line" \
"<stdin>:1: error: Expected = somewhere in this line" \
"a\nb=y\nc=z\n"
test_scriptindex_error "no = in input line" \
"<stdin>:2: error: Expected = somewhere in this line" \
"a=x\nby\nc=z\n"
test_scriptindex_error "no = in input line" \
"<stdin>:3: error: Expected = somewhere in this line" \
"a=x\n=yz\nbcd\ne=q"
# Test handling of extra blank lines.
printf 'id : unique=Q boolean=Q\nf : field' > "$TEST_INDEXSCRIPT"
test_scriptindex "extra blank lines" \
"\nid=1\nf=a\n\n\nid=2\nf=b\n\n"
test_scriptindex "extra blank lines with CRs" \
"\r\nid=1\r\nf=a\r\n\r\n\r\nid=2\r\nf=b\r\n\r\n"
# Feature tests for scriptindex `index` and `indexnopos` actions. # Feature tests for scriptindex `index` and `indexnopos` actions.
printf '%s\n' 't : index=XT' 'n : indexnopos=XN' > "$TEST_INDEXSCRIPT" printf '%s\n' 't : index=XT' 'n : indexnopos=XN' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex 'INDEX and INDEXNOPOS actions' \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END' 't=positional text\nn=no pos here'
t=positional text
n=no pos here
END
printf '$msize' > "$TEST_TEMPLATE" printf '$msize' > "$TEST_TEMPLATE"
testcase '1' P.XT='"positional text"' testcase '1' P.XT='"positional text"'
testcase '1' P.XN='no AND pos' testcase '1' P.XN='no AND pos'
testcase '0' P.XN='"no pos"' testcase '0' P.XN='"no pos"'
# Feature tests for scriptindex `split` action. # Feature tests for scriptindex `split` action.
printf 'STATUS : field split=| field=SPLITSTATUS\nSTATUS : field=x' > "$TEST_IND EXSCRIPT" printf 'STATUS : field split=| field=SPLITSTATUS\nSTATUS : field=x' > "$TEST_IND EXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex 'SPLIT action' \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END' 'STATUS=PENDING|REVIEW'
STATUS=PENDING|REVIEW
END
printf '$field{STATUS,1}/$field{x,1}/$list{$field{SPLITSTATUS,1},$.}' > "$TEST_T EMPLATE" printf '$field{STATUS,1}/$field{x,1}/$list{$field{SPLITSTATUS,1},$.}' > "$TEST_T EMPLATE"
testcase 'PENDING|REVIEW/PENDING|REVIEW/PENDING,REVIEW' P=text testcase 'PENDING|REVIEW/PENDING|REVIEW/PENDING,REVIEW' P=text
# Feature test for scriptindex `split` action with `dedup` operation. # Feature test for scriptindex `split` action with `dedup` operation.
printf 'STATUS : field split=|,dedup field=SPLITSTATUS\n' > "$TEST_INDEXSCRIPT" printf 'STATUS : field split=|,dedup field=SPLITSTATUS\n' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex 'test SPLIT with DEDUP' \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END' 'STATUS=REVIEW|PENDING|PENDING|REVIEW'
STATUS=REVIEW|PENDING|PENDING|REVIEW
END
printf '$field{STATUS,1}/$list{$field{SPLITSTATUS,1},$.}' > "$TEST_TEMPLATE" printf '$field{STATUS,1}/$list{$field{SPLITSTATUS,1},$.}' > "$TEST_TEMPLATE"
testcase 'REVIEW|PENDING|PENDING|REVIEW/REVIEW,PENDING' P=text testcase 'REVIEW|PENDING|PENDING|REVIEW/REVIEW,PENDING' P=text
# Feature test for scriptindex `split` action with `sort` operation. # Feature test for scriptindex `split` action with `sort` operation.
printf 'STATUS : field split=|,sort field=SPLITSTATUS\n' > "$TEST_INDEXSCRIPT" printf 'STATUS : field split=|,sort field=SPLITSTATUS\n' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex 'test SPLIT with SORT' \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END' 'STATUS=REVIEW|PENDING|PENDING|REVIEW'
STATUS=REVIEW|PENDING|PENDING|REVIEW
END
printf '$field{STATUS,1}/$list{$field{SPLITSTATUS,1},$.}' > "$TEST_TEMPLATE" printf '$field{STATUS,1}/$list{$field{SPLITSTATUS,1},$.}' > "$TEST_TEMPLATE"
testcase 'REVIEW|PENDING|PENDING|REVIEW/PENDING,PENDING,REVIEW,REVIEW' P=text testcase 'REVIEW|PENDING|PENDING|REVIEW/PENDING,PENDING,REVIEW,REVIEW' P=text
# Feature test for scriptindex `split` action with `none` operation. # Feature test for scriptindex `split` action with `none` operation.
printf 'STATUS : field split=|,none field=SPLITSTATUS\n' > "$TEST_INDEXSCRIPT" printf 'STATUS : field split=|,none field=SPLITSTATUS\n' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex 'test SPLIT with NONE' \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END' 'STATUS=REVIEW|PENDING|PENDING|REVIEW'
STATUS=REVIEW|PENDING|PENDING|REVIEW
END
printf '$field{STATUS,1}/$list{$field{SPLITSTATUS,1},$.}' > "$TEST_TEMPLATE" printf '$field{STATUS,1}/$list{$field{SPLITSTATUS,1},$.}' > "$TEST_TEMPLATE"
testcase 'REVIEW|PENDING|PENDING|REVIEW/REVIEW,PENDING,PENDING,REVIEW' P=text testcase 'REVIEW|PENDING|PENDING|REVIEW/REVIEW,PENDING,PENDING,REVIEW' P=text
# Feature test for scriptindex `split` action with `prefixes` operation. # Feature test for scriptindex `split` action with `prefixes` operation.
printf 'STATUS : field split=|,prefixes field=SPLITSTATUS\n' > "$TEST_INDEXSCRIP T" printf 'STATUS : field split=|,prefixes field=SPLITSTATUS\n' > "$TEST_INDEXSCRIP T"
rm -rf "$TEST_DB" test_scriptindex 'test SPLIT with PREFIXES' \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END' 'STATUS=REVIEW|PENDING|PENDING|REVIEW'
STATUS=REVIEW|PENDING|PENDING|REVIEW
END
printf '$field{STATUS,1}/$list{$field{SPLITSTATUS,1},$.}' > "$TEST_TEMPLATE" printf '$field{STATUS,1}/$list{$field{SPLITSTATUS,1},$.}' > "$TEST_TEMPLATE"
testcase 'REVIEW|PENDING|PENDING|REVIEW/REVIEW,REVIEW|PENDING,REVIEW|PENDING|PEN DING,REVIEW|PENDING|PENDING|REVIEW' P=text testcase 'REVIEW|PENDING|PENDING|REVIEW/REVIEW,REVIEW|PENDING,REVIEW|PENDING|PEN DING,REVIEW|PENDING|PENDING|REVIEW' P=text
# Feature tests for scriptindex `split` action with no explicit operation. # Feature tests for scriptindex `split` action with no explicit operation.
printf 'STATUS : field split=| field=SPLITSTATUS\n' > "$TEST_INDEXSCRIPT" printf 'STATUS : field split=| field=SPLITSTATUS\n' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex 'test SPLIT with implicit op' \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END' 'STATUS=PENDING|REVIEW|PENDING|REVIEW'
STATUS=PENDING|REVIEW|PENDING|REVIEW
END
printf '$field{STATUS,1}/$list{$field{SPLITSTATUS,1},$.}' > "$TEST_TEMPLATE" printf '$field{STATUS,1}/$list{$field{SPLITSTATUS,1},$.}' > "$TEST_TEMPLATE"
testcase 'PENDING|REVIEW|PENDING|REVIEW/PENDING,REVIEW,PENDING,REVIEW' P=text testcase 'PENDING|REVIEW|PENDING|REVIEW/PENDING,REVIEW,PENDING,REVIEW' P=text
# Feature test for scriptindex `split` action with multi-character delimiter. # Feature test for scriptindex `split` action with multi-character delimiter.
printf 'STATUS : field split=$. field=SPLITSTATUS\n' > "$TEST_INDEXSCRIPT" printf 'STATUS : field split=$. field=SPLITSTATUS\n' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex 'test SPLIT with multi-char delimiter' \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END' 'STATUS=PENDING$.$.REVIEW,PENDING$.REVIEW'
STATUS=PENDING$.$.REVIEW,PENDING$.REVIEW
END
printf '$field{STATUS,1}/$list{$field{SPLITSTATUS,1},|}' > "$TEST_TEMPLATE" printf '$field{STATUS,1}/$list{$field{SPLITSTATUS,1},|}' > "$TEST_TEMPLATE"
testcase 'PENDING$.$.REVIEW,PENDING$.REVIEW/PENDING|REVIEW,PENDING|REVIEW' P=tex t testcase 'PENDING$.$.REVIEW,PENDING$.REVIEW/PENDING|REVIEW,PENDING|REVIEW' P=tex t
# Feature test for scriptindex `split` action with multi-character delimiter # Feature test for scriptindex `split` action with multi-character delimiter
# with potential overlap. # with potential overlap.
printf 'STATUS : field split=:: field=SPLITSTATUS\n' > "$TEST_INDEXSCRIPT" printf 'STATUS : field split=:: field=SPLITSTATUS\n' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex 'test SPLIT with overlapping multi-char delimiter' \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END' 'STATUS=::Foo::::Bar:Baz:::Hello::'
STATUS=::Foo::::Bar:Baz:::Hello::
END
printf '$field{STATUS,1}/$list{$field{SPLITSTATUS,1},|}' > "$TEST_TEMPLATE" printf '$field{STATUS,1}/$list{$field{SPLITSTATUS,1},|}' > "$TEST_TEMPLATE"
testcase '::Foo::::Bar:Baz:::Hello::/Foo|Bar:Baz|:Hello' P=text testcase '::Foo::::Bar:Baz:::Hello::/Foo|Bar:Baz|:Hello' P=text
# Feature test for scriptindex `split` action with multi-character delimiter # Feature test for scriptindex `split` action with multi-character delimiter
# with `prefixes` operation. # with `prefixes` operation.
printf 'STATUS : field split=::,prefixes field=SPLITSTATUS\n' > "$TEST_INDEXSCRI PT" printf 'STATUS : field split=::,prefixes field=SPLITSTATUS\n' > "$TEST_INDEXSCRI PT"
rm -rf "$TEST_DB" test_scriptindex 'test SPLIT with PREFIXES and multi-char delimiter' \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END' 'STATUS=::Foo::::Bar:Baz:::Hello::'
STATUS=::Foo::::Bar:Baz:::Hello::
END
printf '$field{STATUS,1}/$list{$field{SPLITSTATUS,1},|}' > "$TEST_TEMPLATE" printf '$field{STATUS,1}/$list{$field{SPLITSTATUS,1},|}' > "$TEST_TEMPLATE"
testcase '::Foo::::Bar:Baz:::Hello::/::Foo|::Foo::|::Foo::::Bar:Baz|::Foo::::Bar :Baz:::Hello|::Foo::::Bar:Baz:::Hello::' P=text testcase '::Foo::::Bar:Baz:::Hello::/::Foo|::Foo::|::Foo::::Bar:Baz|::Foo::::Bar :Baz:::Hello|::Foo::::Bar:Baz:::Hello::' P=text
# Feature test for scriptindex `split` action with quoted `,` delimiter. # Feature test for scriptindex `split` action with quoted `,` delimiter.
printf 'STATUS : field split="," field=SPLITSTATUS\n' > "$TEST_INDEXSCRIPT" printf 'STATUS : field split="," field=SPLITSTATUS\n' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex 'test SPLIT with quoted comma delimiter' \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END' 'STATUS=PENDING,REVIEW,PENDING,REVIEW'
STATUS=PENDING,REVIEW,PENDING,REVIEW
END
printf '$field{STATUS,1}/$list{$field{SPLITSTATUS,1},|}' > "$TEST_TEMPLATE" printf '$field{STATUS,1}/$list{$field{SPLITSTATUS,1},|}' > "$TEST_TEMPLATE"
testcase 'PENDING,REVIEW,PENDING,REVIEW/PENDING|REVIEW|PENDING|REVIEW' P=text testcase 'PENDING,REVIEW,PENDING,REVIEW/PENDING|REVIEW|PENDING|REVIEW' P=text
# Feature test for nested scriptindex `split` action. # Feature test for nested scriptindex `split` action.
printf 'in : split=; field=one lower split="," field=two\nin : field' > "$TEST_I NDEXSCRIPT" printf 'in : split=; field=one lower split="," field=two\nin : field' > "$TEST_I NDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex 'nested SPLIT action' \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END' 'in=a,b,c;10,21,32;XY,YZ'
in=a,b,c;10,21,32;XY,YZ
END
printf '$field{in,1}/$list{$field{one,1},|}/$list{$field{two,1},|}' > "$TEST_TEM PLATE" printf '$field{in,1}/$list{$field{one,1},|}/$list{$field{two,1},|}' > "$TEST_TEM PLATE"
testcase 'a,b,c;10,21,32;XY,YZ/a,b,c|10,21,32|XY,YZ/a|b|c|10|21|32|xy|yz' P=text testcase 'a,b,c;10,21,32;XY,YZ/a,b,c|10,21,32|XY,YZ/a|b|c|10|21|32|xy|yz' P=text
# Test scriptindex `split` action error cases.
printf 'in : split="" field=one\nin : field' > "$TEST_INDEXSCRIPT"
test_scriptindex_error "'split' error for empty separator" \
"$TEST_INDEXSCRIPT:1:13: error: Split delimiter can't be empty"
printf 'in : split=|,foo field=one\nin : field' > "$TEST_INDEXSCRIPT"
test_scriptindex_error "'split' error for invalid operation" \
"$TEST_INDEXSCRIPT:1:14: error: Bad split operation 'foo'"
# Feature tests for scriptindex `hextobin` action. # Feature tests for scriptindex `hextobin` action.
printf 'hex : hextobin value=0' > "$TEST_INDEXSCRIPT" printf 'hex : hextobin value=0' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex 'HEXTOBIN action' \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END' 'hex=
hex=
hex=41 hex=41
hex=54657374 hex=54657374
hex=4b696C6c hex=4b696C6c
END '
printf '$list{$map{$split{$cgi{DOCIDS}},$value{0,$_}},|}' > "$TEST_TEMPLATE" printf '$list{$map{$split{$cgi{DOCIDS}},$value{0,$_}},|}' > "$TEST_TEMPLATE"
testcase '|A|Test|Kill' DOCIDS='1 2 3 4' testcase '|A|Test|Kill' DOCIDS='1 2 3 4'
# Feature test error cases for scriptindex `hextobin` action. # Feature test error cases for scriptindex `hextobin` action.
rm -rf "$TEST_DB" test_scriptindex_error 'bad hex digit' \
echo hex=7g |\ "<stdin>:1: error: hextobin: input must be all hex digits" \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" 2>&1 > /dev/null |\ 'hex=7g'
grep -q ":1: error: hextobin: input must be all hex digits" ||\ test_scriptindex_error 'bad hex length' \
{ echo "scriptindex hextobin didn't give error for bad hex digit";\ "<stdin>:1: error: hextobin: input must have even length" \
failed=`expr $failed + 1`; } 'hex=404'
echo hex=404 |\
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" 2>&1 > /dev/null |\
grep -q ":1: error: hextobin: input must have even length" ||\
{ echo "scriptindex hextobin didn't give error for odd length hex string";\
failed=`expr $failed + 1`; }
testcase '7g|404' DOCIDS='1 2'
# Feature test for scriptindex `spell` action. # Feature test for scriptindex `spell` action.
printf '%s\n' 's : spell index' 'n : index' > "$TEST_INDEXSCRIPT" printf '%s\n' 's : spell index' 'n : index' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex 'SPELL action' \
printf '%s\n\n' 's=some words test' 'n=tent'|$SCRIPTINDEX "$TEST_DB" "$TEST_INDE 's=some words test\n\nn=tent\n\n'
XSCRIPT" > /dev/null
printf '$set{flag_spelling_correction,true}$suggestion' > "$TEST_TEMPLATE" printf '$set{flag_spelling_correction,true}$suggestion' > "$TEST_TEMPLATE"
testcase 'some test' P='home nest' testcase 'some test' P='home nest'
testcase 'a test' P='a tent' testcase 'a test' P='a tent'
testcase '' P='gent' testcase '' P='gent'
# Feature tests for scriptindex `squash` and `ltrim`/`rtrim`/`trim` actions. # Feature tests for scriptindex `squash` and `ltrim`/`rtrim`/`trim` actions.
printf 'squash : squash field\nltrim : ltrim field\nrtrim : rtrim field\ntrim : trim field\n' > "$TEST_INDEXSCRIPT" printf 'squash : squash field\nltrim : ltrim field\nrtrim : rtrim field\ntrim : trim field\n' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB"
whitespace_test=`printf "\t lots\v\fof\t whitespace\f "` whitespace_test=`printf "\t lots\v\fof\t whitespace\f "`
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<END test_scriptindex 'SQUASH and trim actions' \
squash=$whitespace_test "squash=$whitespace_test
ltrim=$whitespace_test ltrim=$whitespace_test
rtrim=$whitespace_test rtrim=$whitespace_test
trim=$whitespace_test trim=$whitespace_test
squash=a b squash=a b
ltrim=a b ltrim=a b
rtrim=a b rtrim=a b
trim=a b trim=a b
squash=xyz squash=xyz
ltrim=xyz ltrim=xyz
rtrim=xyz rtrim=xyz
trim=xyz trim=xyz
END "
printf '$json{$field{$cgi{F},$cgi{ID}}}' > "$TEST_TEMPLATE" printf '$json{$field{$cgi{F},$cgi{ID}}}' > "$TEST_TEMPLATE"
testcase 'lots of whitespace' F=squash ID=1 testcase 'lots of whitespace' F=squash ID=1
testcase 'lots\u000b\fof\t whitespace\f ' F=ltrim ID=1 testcase 'lots\u000b\fof\t whitespace\f ' F=ltrim ID=1
testcase '\t lots\u000b\fof\t whitespace' F=rtrim ID=1 testcase '\t lots\u000b\fof\t whitespace' F=rtrim ID=1
testcase 'lots\u000b\fof\t whitespace' F=trim ID=1 testcase 'lots\u000b\fof\t whitespace' F=trim ID=1
for f in squash ltrim rtrim trim ; do for f in squash ltrim rtrim trim ; do
testcase 'a b' F=$f ID=2 testcase 'a b' F=$f ID=2
testcase 'xyz' F=$f ID=3 testcase 'xyz' F=$f ID=3
done done
# Feature tests for scriptindex `truncate` action. # Feature tests for scriptindex `truncate` action.
printf 'x : field=x truncate=9 field=9 truncate=3 field=3 truncate=2 field=2 tru ncate=1 field=1 truncate=0 field=0\n' > "$TEST_INDEXSCRIPT" printf 'x : field=x truncate=9 field=9 truncate=3 field=3 truncate=2 field=2 tru ncate=1 field=1 truncate=0 field=0\n' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex 'TRUNCATE action' \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<END 'x=really long field
x=really long field
x=xö xxxxö x x=xö xxxxö x
x=ö xxxxö x x=ö xxxxö x
x=x x xx🥝 x x=x x xx🥝 x
x=a test x=a test
x=tri x=tri
x=du x=du
x=1 x=1
x= x=
END '
printf '$foreach{$split{1 2 3 4 5 6 7 8 9},$set{d,$_}$list{$map{$split{x 9 3 2 1 0},$field{$_,$opt{d}}},|}:}' > "$TEST_TEMPLATE" printf '$foreach{$split{1 2 3 4 5 6 7 8 9},$set{d,$_}$list{$map{$split{x 9 3 2 1 0},$field{$_,$opt{d}}},|}:}' > "$TEST_TEMPLATE"
testcase 'really long field|really|rea|re|r|:xö xxxxö x|xö|xö|x|x|:ö xxxxö x|ö x xxxö|ö|ö||:x x xx🥝 x|x x|x x|x|x|:a test|a test|a|a|a|:tri|tri|tri|tr|t|:du|du|d u|du|d|:1|1|1|1|1|:|||||:' testcase 'really long field|really|rea|re|r|:xö xxxxö x|xö|xö|x|x|:ö xxxxö x|ö x xxxö|ö|ö||:x x xx🥝 x|x x|x x|x|x|:a test|a test|a|a|a|:tri|tri|tri|tr|t|:du|du|d u|du|d|:1|1|1|1|1|:|||||:'
# Feature tests for scriptindex `unhtml` action. # Feature tests for scriptindex `unhtml` action.
printf '%s\n' 't : unhtml field=h' > "$TEST_INDEXSCRIPT" printf '%s\n' 't : unhtml field=h' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex 'UNHTML action' \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END' 't=<b>No</b>table
t=<b>No</b>table
t=<p>foo</p>d<p>bar<B>b</B></p> t=<p>foo</p>d<p>bar<B>b</B></p>
END '
printf '$list{$map{$split{$cgi{DOCIDS}},$field{h,$_}},|}' > "$TEST_TEMPLATE" printf '$list{$map{$split{$cgi{DOCIDS}},$field{h,$_}},|}' > "$TEST_TEMPLATE"
testcase "`printf 'Notable|foo\rd\rbarb'`" DOCIDS='1 2' testcase "`printf 'Notable|foo\rd\rbarb'`" DOCIDS='1 2'
# Feature test for scriptindex `weight` action. # Feature test for scriptindex `weight` action.
printf '%s\n' 't : index' 'w : weight=2 index' > "$TEST_INDEXSCRIPT" printf '%s\n' 't : index' 'w : weight=2 index' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex 'WEIGHT action' \
printf '%s\n\n' 't=test' 'w=test' 't=test test test'|$SCRIPTINDEX "$TEST_DB" "$T 't=test
EST_INDEXSCRIPT" > /dev/null
w=test
t=test test test'
printf '|$hitlist{$id|}' > "$TEST_TEMPLATE" printf '|$hitlist{$id|}' > "$TEST_TEMPLATE"
testcase '|3|2|1|' P=test testcase '|3|2|1|' P=test
# Test bad parameter values to `weight` action.
printf 'foo : weight=-2 index weight=1.5 index=A weight=-1.5 index=B' > "$TEST_I
NDEXSCRIPT"
test_scriptindex_error "bad 'weight' parameter" \
"$TEST_INDEXSCRIPT:1:14: error: Index action 'weight' takes a non-negative int
eger argument
$TEST_INDEXSCRIPT:1:30: error: Index action 'weight' takes a non-negative intege
r argument
$TEST_INDEXSCRIPT:1:49: error: Index action 'weight' takes a non-negative intege
r argument"
# Test useless action warnings. # Test useless action warnings.
printf 'foo : index weight=2' > "$TEST_INDEXSCRIPT" printf 'foo : index weight=2' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex_warning "useless 'weight' action" \
if $SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" < /dev/null 2>&1 \ "$TEST_INDEXSCRIPT:1:13: warning: Index action 'weight' has no effect*"
| grep -q ":1:13: warning: Index action 'weight' has no effect" ; then
: # OK
else
echo "scriptindex didn't give expected warning for useless 'weight' action"
failed=`expr $failed + 1`
fi
printf 'foo : weight=2 weight=3 index' > "$TEST_INDEXSCRIPT" printf 'foo : weight=2 weight=3 index' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex_warning "useless 'weight' action" \
if $SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" < /dev/null 2>&1 \ "$TEST_INDEXSCRIPT:1:7: warning: Index action 'weight' has no effect*"
| grep -q ":1:7: warning: Index action 'weight' has no effect" ; then
: # OK
else
echo "scriptindex didn't give expected warning for useless 'weight' action"
failed=`expr $failed + 1`
fi
printf 'foo : index lower' > "$TEST_INDEXSCRIPT" printf 'foo : index lower' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex_warning "useless 'lower' action" \
if $SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" < /dev/null 2>&1 \ "$TEST_INDEXSCRIPT:1:13: warning: Index action 'lower' has no effect*"
| grep -q ":1:13: warning: Index action 'lower' has no effect" ; then
: # OK
else
echo "scriptindex didn't give expected warning for useless 'lower' action"
failed=`expr $failed + 1`
fi
# Test bad fieldname errors. # Test bad fieldname errors.
printf 'foo *bar : index' > "$TEST_INDEXSCRIPT" printf 'foo *bar _bar b!ar: index' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex_error 'bad field names' \
rc=0 "$TEST_INDEXSCRIPT:1:5: error: field name must start with alphanumeric
out=`$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" < /dev/null 2>&1` || rc=$? $TEST_INDEXSCRIPT:1:10: error: field name must start with alphanumeric
if [ $rc -eq 0 ] ; then $TEST_INDEXSCRIPT:1:16: error: bad character '!' in field name"
echo "scriptindex didn't exit with non-zero return code on bad fieldname"
failed=`expr $failed + 1`
elif printf '%s' "$out" \
| grep -q ":1:5: error: field name must start with alphanumeric" ; then
: # OK
else
echo "scriptindex didn't give expected error for a bad fieldname"
failed=`expr $failed + 1`
fi
printf 'foo b!ar : index' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB"
rc=0
out=`$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" < /dev/null 2>&1` || rc=$?
if [ $rc -eq 0 ] ; then
echo "scriptindex didn't exit with non-zero return code on bad fieldname"
failed=`expr $failed + 1`
elif printf '%s' "$out" \
| grep -q ":1:6: error: bad character '!' in fieldname" ; then
: # OK
else
echo "scriptindex didn't give expected error for a bad fieldname"
failed=`expr $failed + 1`
fi
# Test unwanted action argument. # Test unwanted action argument.
printf 'foo : spell=test index' > "$TEST_INDEXSCRIPT" printf 'foo : spell=test index' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex_error 'unwanted action argument' \
rc=0 "$TEST_INDEXSCRIPT:1:12: error: Index action 'spell' doesn't take an argument"
out=`$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" < /dev/null 2>&1` || rc=$?
if [ $rc -eq 0 ] ; then
echo "scriptindex didn't exit with non-zero return code on unwanted action a
rgument"
failed=`expr $failed + 1`
elif printf '%s' "$out" \
| grep -q ":1:12: error: Index action 'spell' doesn't take an argument" ; th
en
: # OK
else
echo "scriptindex didn't give expected error for unwanted action argument"
failed=`expr $failed + 1`
fi
# Test missing closing quote. # Test missing closing quote.
printf 'foo : index="XFOO' > "$TEST_INDEXSCRIPT" printf '%s\n' 'foo : index="XFOO' 'bar : index="XFOO\"' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex_error 'missing closing quote' \
rc=0 "$TEST_INDEXSCRIPT:1:18: error: No closing quote
out=`$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" < /dev/null 2>&1` || rc=$? $TEST_INDEXSCRIPT:2:20: error: No closing quote"
if [ $rc -eq 0 ] ; then
echo "scriptindex didn't exit with non-zero return code for missing closing
quote"
failed=`expr $failed + 1`
elif printf '%s' "$out" \
| grep -q ":1:18: error: No closing quote" ; then
: # OK
else
echo "scriptindex didn't give expected error for missing closing quote"
failed=`expr $failed + 1`
fi
# Feature tests for scriptindex `termprefix` and `unprefix` actions. # Feature tests for scriptindex `termprefix` and `unprefix` actions.
printf '$termprefix{$cgi{B}}|$unprefix{$cgi{B}}' > "$TEST_TEMPLATE" printf '$termprefix{$cgi{B}}|$unprefix{$cgi{B}}' > "$TEST_TEMPLATE"
testcase '|' B='' testcase '|' B=''
testcase '|something' B='something' testcase '|something' B='something'
testcase '|42' B='42' testcase '|42' B='42'
testcase '|3bad' B='3bad' testcase '|3bad' B='3bad'
testcase '|&something' B='&something' testcase '|&something' B='&something'
testcase '|:something' B=':something' testcase '|:something' B=':something'
testcase 'H|example.org' B='Hexample.org' testcase 'H|example.org' B='Hexample.org'
skipping to change at line 1130 skipping to change at line 1218
testcase 'XCASE|TITLE' B='XCASE:TITLE' testcase 'XCASE|TITLE' B='XCASE:TITLE'
testcase 'XNUM|42' B='XNUM42' testcase 'XNUM|42' B='XNUM42'
testcase 'XNUM|3bad' B='XNUM3bad' testcase 'XNUM|3bad' B='XNUM3bad'
# Regression test for $truncate with maxlen < the length of the indicator # Regression test for $truncate with maxlen < the length of the indicator
# string. # string.
printf '$truncate{$cgi{input},$cgi{maxlen},$cgi{ind},$cgi{ind2}}$seterror{$opt{e rror}}' > "$TEST_TEMPLATE" printf '$truncate{$cgi{input},$cgi{maxlen},$cgi{ind},$cgi{ind2}}$seterror{$opt{e rror}}' > "$TEST_TEMPLATE"
testcase 'w...' input='wwwwww' maxlen=4 ind='...' ind2='...' testcase 'w...' input='wwwwww' maxlen=4 ind='...' ind2='...'
testcase '' input='s' maxlen=0 ind='...' ind2='...' testcase '' input='s' maxlen=0 ind='...' ind2='...'
# Feature tests for scriptindex `unique` action.
printf '%s\n' 'id : boolean=Q unique=Q' 'id f : field' > "$TEST_INDEXSCRIPT"
test_scriptindex 'UNIQUE action' \
'id=1
f=wan
id=2
f=too
id=3
f=free
id=4
f=fore
id=1
f=one
id=2
id=4
f=
id=3
dummy='
printf '$field{id,$cgi{id}}|$field{f,$cgi{id}}$error' > "$TEST_TEMPLATE"
testcase '1|one' id=1
# Since 1.5.0, document 2 gets deleted instead.
testcase '2|' id=2
testcase '3|' id=3
testcase '4|' id=4
# Test `unique` action warning.
printf '%s\n' 'id : unique=Q boolean=W' 'id f : field' > "$TEST_INDEXSCRIPT"
test_scriptindex_warning 'unique without boolean' \
"$TEST_INDEXSCRIPT:1:6: warning: Index action 'unique=Q' without 'boolean=Q'
$TEST_INDEXSCRIPT:1:6: note: 'unique' doesn't implicitly add a boolean term"
# Test `unique` action gives error when not used for a record.
printf '%s\n' 'id : boolean=Q unique=Q' 'id f : field' > "$TEST_INDEXSCRIPT"
test_scriptindex_warning 'missing unique field' \
"<stdin>:4: warning: UNIQUE action unused in this record" \
'id=1\nf=wan\n\nf=\n'
# Test $subdb and $subid. # Test $subdb and $subid.
rm -rf "$TEST_DB" rm -rf "$TEST_DB"
printf 'inmemory' > "$TEST_DB" printf 'inmemory' > "$TEST_DB"
printf 'inmemory' > "${TEST_DB}2" printf 'inmemory' > "${TEST_DB}2"
printf 'inmemory\ninmemory\n' > "${TEST_DB}3" printf 'inmemory\ninmemory\n' > "${TEST_DB}3"
printf '$subdb{$cgi{ID}}|$subid{$cgi{ID}}' > "$TEST_TEMPLATE" printf '$subdb{$cgi{ID}}|$subid{$cgi{ID}}' > "$TEST_TEMPLATE"
testcase "$TEST_DB|1" ID=1 testcase "$TEST_DB|1" ID=1
testcase "$TEST_DB|1" ID=1 DB="$TEST_DB/${TEST_DB}2" testcase "$TEST_DB|1" ID=1 DB="$TEST_DB/${TEST_DB}2"
testcase "${TEST_DB}2|1" ID=2 DB="$TEST_DB/${TEST_DB}2" testcase "${TEST_DB}2|1" ID=2 DB="$TEST_DB/${TEST_DB}2"
testcase "${TEST_DB}|2" ID=3 DB="$TEST_DB/${TEST_DB}2" testcase "${TEST_DB}|2" ID=3 DB="$TEST_DB/${TEST_DB}2"
skipping to change at line 1200 skipping to change at line 1332
# Feature tests of scriptindex. # Feature tests of scriptindex.
# Regression test: non-zero exit status for unknown option. # Regression test: non-zero exit status for unknown option.
if $SCRIPTINDEX --to-be-or-not-to-be "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null < /dev/null 2>&1; then if $SCRIPTINDEX --to-be-or-not-to-be "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null < /dev/null 2>&1; then
echo "scriptindex didn't give error for unknown option" echo "scriptindex didn't give error for unknown option"
failed=`expr $failed + 1` failed=`expr $failed + 1`
fi fi
# Regression test: error given for multiple `unique` actions. # Regression test: error given for multiple `unique` actions.
printf 'uuid : boolean=Q unique=Q\nguid : boolean=G unique=G' > "$TEST_INDEXSCRI printf 'id : boolean=Q unique=Q\nguid : boolean=G unique=G' > "$TEST_INDEXSCRIPT
PT" "
rm -rf "$TEST_DB" test_scriptindex_error 'UNIQUE used more than once' \
if $SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null < /dev/null 2>&1; the "$TEST_INDEXSCRIPT:2:18: error: Index action 'unique' used more than once
n $TEST_INDEXSCRIPT:1:16: note: Previously used here"
echo "scriptindex didn't reject 'unique' action being used more than once"
failed=`expr $failed + 1`
fi
# Test we check for hash's argument being an integer (new in 1.4.6). # Test we check for hash's argument being an integer (new in 1.4.6).
printf 'url : hash=37.3 boolean=Q unique=Q' > "$TEST_INDEXSCRIPT" printf 'url : hash=37.3 boolean=Q unique=Q' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex_error "'hash' with a non-integer argument" \
if $SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" < /dev/null 2>&1 \ "$TEST_INDEXSCRIPT:1:14: error: Index action 'hash' takes an integer argument"
| grep -q ":1:14: warning: Index action 'hash' takes an integer argument" ;
then
: # OK
else
echo "scriptindex didn't reject 'hash' with a non-integer argument"
failed=`expr $failed + 1`
fi
# Test we give a helpful error for an action with a digit in (regression # Test we give a helpful error for an action with a digit in (regression
# test for fix in 1.4.6). # test for fix in 1.4.6).
# #
# This used to give the confusing: # This used to give the confusing:
# Unknown index action '' # Unknown index action ''
printf 'url : index4' > "$TEST_INDEXSCRIPT" printf 'url : index4' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex_error 'bad index action with a digit' \
rc=0 "$TEST_INDEXSCRIPT:1:7: error: Unknown index action 'index4'"
out=`$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" < /dev/null 2>&1` || rc=$?
if [ $rc -eq 0 ] ; then
echo "scriptindex didn't exit with non-zero return code for bad index action
with a digit"
failed=`expr $failed + 1`
elif printf '%s' "$out" \
| grep -q ":1:7: error: Unknown index action 'index4'" ; then
: # OK
else
echo "scriptindex didn't give expected error for bad index action with a dig
it"
failed=`expr $failed + 1`
fi
# Test we give a helpful error if an = sign is missed out before an optional # Test we give a helpful error if an = sign is missed out before an optional
# numeric argument (regression test for fix in 1.4.6). # numeric argument (regression test for fix in 1.4.6).
# #
# This used to give the confusing: # This used to give the confusing:
# Unknown index action '' # Unknown index action ''
printf 'url : hash 42' > "$TEST_INDEXSCRIPT" printf 'url : hash 42' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex_error 'missing equals sign' \
rc=0 "$TEST_INDEXSCRIPT:1:12: error: Unknown index action '42'"
out=`$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" < /dev/null 2>&1` || rc=$?
if [ $rc -eq 0 ] ; then
echo "scriptindex didn't exit with non-zero return code for a missing equals
sign"
failed=`expr $failed + 1`
elif printf '%s' "$out" \
| grep -q ":1:12: error: Unknown index action '42'" ; then
: # OK
else
echo "scriptindex didn't give expected error for a missing equals sign"
failed=`expr $failed + 1`
fi
# Test we warn about spaces before and after '='. # Test we warn about spaces before and after '='.
# #
# This has never been documented as supported, and was deprecated in 1.4.6 # This has never been documented as supported, and was deprecated in 1.4.6
# because it resulted in this quietly using `hash` as the field name, which is # because it resulted in this quietly using `hash` as the field name, which is
# probably not what was intended: # probably not what was intended:
# #
# url : field= hash boolean=Q unique=Q # url : field= hash boolean=Q unique=Q
printf 'url : field= hash boolean=Q unique=Q' > "$TEST_INDEXSCRIPT" printf 'url : field= hash boolean=Q unique=Q' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex_warning 'space after "="' \
if $SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" < /dev/null 2>&1 \ "$TEST_INDEXSCRIPT:1:13: warning: putting spaces between '=' and the argument
| grep -q ":1:13: warning: putting spaces between '=' and the argument is de is deprecated"
precated" ; then
: # OK
else
echo "scriptindex didn't give expected warning for space after '='"
failed=`expr $failed + 1`
fi
printf 'url : field =link' > "$TEST_INDEXSCRIPT" printf 'url : field =link' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex_warning 'space before "="' \
if $SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" < /dev/null 2>&1 \ "$TEST_INDEXSCRIPT:1:12: warning: putting spaces between the action and '=' is
| grep -q ":1:12: warning: putting spaces between the action and '=' is depr deprecated"
ecated" ; then
: # OK
else
echo "scriptindex didn't give expected warning for space before '='"
failed=`expr $failed + 1`
fi
# Feature tests for scriptindex `date` action. # Feature tests for scriptindex `date` action.
printf '%s\n' 'd : date=unix' 'g : date=unixutc' > "$TEST_INDEXSCRIPT" printf '%s\n' 'd : date=unix' 'g : date=unixutc' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB"
# `date=unix` works in the current timezone, so set that explicitly so the # `date=unix` works in the current timezone, so set that explicitly so the
# build doesn't fail if run in a timezone which is behind UTC. # build doesn't fail if run in a timezone which is behind UTC.
TZ=UTC $SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END' TZ=UTC test_scriptindex 'DATE action' \
d= 'd=\n\nd=0\n\nd=1541478429'
d=0
d=1541478429
END
printf '$list{$map{$range{1,3},$list{$allterms{$_}, }},|}' > "$TEST_TEMPLATE" printf '$list{$map{$range{1,3},$list{$allterms{$_}, }},|}' > "$TEST_TEMPLATE"
testcase '|D19700101 M197001 Y1970|D20181106 M201811 Y2018' testcase '|D19700101 M197001 Y1970|D20181106 M201811 Y2018'
# `date=unixutc` should always work in UTC regardless of the current timezone. # `date=unixutc` should always work in UTC regardless of the current timezone.
rm -rf "$TEST_DB" test_scriptindex 'DATE action with unixutc' \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END' 'g=\n\ng=0\n\ng=1541478429'
g=
g=0
g=1541478429
END
testcase '|D19700101 M197001 Y1970|D20181106 M201811 Y2018' testcase '|D19700101 M197001 Y1970|D20181106 M201811 Y2018'
# Check nested $hitlist{} doesn't result in an infinite loop. # Check nested $hitlist{} doesn't result in an infinite loop.
# Regression test for bug fixed in 1.4.12. # Regression test for bug fixed in 1.4.12.
printf '<|$hitlist{$id(:$hitlist{$id:})|}>' > "$TEST_TEMPLATE" printf '<|$hitlist{$id(:$hitlist{$id:})|}>' > "$TEST_TEMPLATE"
testcase '<|2(:2:3:)|3(:2:3:)|>' B=Y1970 B=Y2018 testcase '<|2(:2:3:)|3(:2:3:)|>' B=Y1970 B=Y2018
# Feature tests for scriptindex `parsedate` action. # Feature tests for scriptindex `parsedate` action.
printf '%s\n' 'DATE : field parsedate=%Y%m%d valuepacked=13' > "$TEST_INDEXSCRIP T" printf '%s\n' 'DATE : field parsedate=%Y%m%d valuepacked=13' > "$TEST_INDEXSCRIP T"
rm -rf "$TEST_DB" test_scriptindex 'PARSEDATE action' \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END' 'DATE=19891204'
DATE=19891204
END
printf '$field{DATE,1}|$unpack{$value{13,1}}|$date{$unpack{$value{13,1}}}' > "$T EST_TEMPLATE" printf '$field{DATE,1}|$unpack{$value{13,1}}|$date{$unpack{$value{13,1}}}' > "$T EST_TEMPLATE"
testcase '19891204|628732800|1989-12-04' P=text testcase '19891204|628732800|1989-12-04' P=text
# Feature tests for scriptindex `parsedate` action. # Feature tests for scriptindex `parsedate` action.
printf '%s\n' \ printf '%s\n' \
'DATE: parsedate="%Y%m%d %T" field=time' \ 'DATE: parsedate="%Y%m%d %T" field=time' \
'TIME_T: parsedate=%s field=time' > "$TEST_INDEXSCRIPT" 'TIME_T: parsedate=%s field=time' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex_warning 'PARSEDATE action' \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null 2>&1 <<'END' '<stdin>:2: warning: "20161202 12:04:22.000000" not fully matched by format "%
DATE=20161202 12:04:22.000000 Y%m%d %T" (".000000" left over) but indexing anyway' \
'DATE=20161202 12:04:22.000000\n\nTIME_T=1480680263'
TIME_T=1480680263
END
printf '$field{time,$cgi{id}}' > "$TEST_TEMPLATE" printf '$field{time,$cgi{id}}' > "$TEST_TEMPLATE"
# Test format which contains a space. # Test format which contains a space.
testcase '1480680262' id=1 testcase '1480680262' id=1
# Regression test - we used to add on the local timezone offset. # Regression test - we used to add on the local timezone offset.
testcase '1480680263' id=2 testcase '1480680263' id=2
if grep -q 'define HAVE_STRUCT_TM_TM_GMTOFF 1' config.h ; then if grep -q 'define HAVE_STRUCT_TM_TM_GMTOFF 1' config.h ; then
# Feature tests for scriptindex `parsedate` action. # Feature tests for scriptindex `parsedate` action.
printf '%s\n' 'DATE: parsedate="%Y%m%d %T %z" field=time' > "$TEST_INDEXSCRIPT " printf '%s\n' 'DATE: parsedate="%Y%m%d %T %z" field=time' > "$TEST_INDEXSCRIPT "
rm -rf "$TEST_DB" test_scriptindex 'PARSEDATE action with %z' \
echo 'DATE=20161202 21:34:22 +0930' | \ 'DATE=20161202 21:34:22 +0930'
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null 2>&1
printf '$field{time,$cgi{id}}' > "$TEST_TEMPLATE" printf '$field{time,$cgi{id}}' > "$TEST_TEMPLATE"
# Test that timezone adjustment is applied. # Test that timezone adjustment is applied.
testcase '1480680262' id=1 testcase '1480680262' id=1
else else
echo "Skipping testcases which need tm_gmtoff member in struct tm" echo "Skipping testcases which need tm_gmtoff member in struct tm"
fi fi
# Feature tests for scriptindex `valuenumeric` action. # Feature tests for scriptindex `valuenumeric` action.
printf '%s\n' 'n : field valuenumeric=0' > "$TEST_INDEXSCRIPT" printf '%s\n' 'n : field valuenumeric=0' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex 'VALUENUMERIC action' \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END' 'n=0\n\nn=1.75\n\nn=-1000000000'
n=0
n=1.75
n=-1000000000
END
printf '$list{$map{$range{1,3},$url{$value{0,$_}}},:}' > "$TEST_TEMPLATE" printf '$list{$map{$range{1,3},$url{$value{0,$_}}},:}' > "$TEST_TEMPLATE"
testcase '%80:%A3:%1F%A4FS%60' testcase '%80:%A3:%1F%A4FS%60'
# Feature tests for scriptindex `load` action. # Feature tests for scriptindex `load` action.
printf '%s\n' 'file : load field' > "$TEST_INDEXSCRIPT" printf '%s\n' 'file : load field' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex_warning 'empty filename in load action' \
rc=0 "<stdin>:1: warning: Empty filename in LOAD action" \
out=`echo 'file='|$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" 2>&1 > /dev/null | 'file='
| rc=$?`
if [ $rc -ne 0 ] ; then
echo "scriptindex gave error for empty filename in load action"
printf '%s\n' "$out"
failed=`expr $failed + 1`
else
case $out in
*':1: warning: Empty filename in LOAD action') ;;
*)
echo "scriptindex didn't give expected warning for empty filename in load
action"
printf '%s\n' "$out"
failed=`expr $failed + 1`
;;
esac
fi
# Feature tests for quoted arguments. # Feature tests for quoted arguments.
printf 'DATE : field=" spaces " date="yyyymmdd"\nTEXT: index="S"\n' > "$TEST_I NDEXSCRIPT" printf 'DATE : field=" spaces " date="yyyymmdd"\nTEXT: index="S"\n' > "$TEST_I NDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex 'quoted arguments' \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END' 'DATE=19891204\nTEXT=This is sample text.\nNEXT=work'
DATE=19891204
TEXT=This is sample text.
NEXT=work
END
printf '$freq{D19891204}|$field{ spaces ,1}' > "$TEST_TEMPLATE" printf '$freq{D19891204}|$field{ spaces ,1}' > "$TEST_TEMPLATE"
testcase '1|19891204' P.S=text testcase '1|19891204' P.S=text
# Use $time to force the match to run. # Use $time to force the match to run.
printf '$if{x$time,$freq{D19891204}}|$field{ spaces ,1}' > "$TEST_TEMPLATE" printf '$if{x$time,$freq{D19891204}}|$field{ spaces ,1}' > "$TEST_TEMPLATE"
testcase '1|19891204' P= testcase '1|19891204' P=
# Feature tests for escaping in quoted arguments. # Feature tests for escaping in quoted arguments.
printf '%s\n' 'esc : field="\tesca\x70e,test\\\""' > "$TEST_INDEXSCRIPT" printf '%s\n' 'esc : field="\tesca\x70e,test\\\""' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex 'escaping in quoted arguments' \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END' 'esc=test'
esc=test
END
printf '$field{$chr{9}escape$.test\\",1}' > "$TEST_TEMPLATE" printf '$field{$chr{9}escape$.test\\",1}' > "$TEST_TEMPLATE"
testcase 'test' P= testcase 'test' P=
printf '%s\n' 'x: split="xx\' 'y: split="xx\q"' > "$TEST_INDEXSCRIPT"
test_scriptindex_error "bad escape sequences" \
"$TEST_INDEXSCRIPT:1:14: error: Bad escaping in quoted action argument
$TEST_INDEXSCRIPT:2:14: error: Bad escape sequence '\\\\q'"
# Ensure the location of the problem is always in the same column so we can # Ensure the location of the problem is always in the same column so we can
# test against a fixed error message including line and column. # test against a fixed error message including line and column.
for badesc in \ for badesc in \
'"xx\' \
'"xx\q"' \
'"\x"' \
'"\x1"' \ '"\x1"' \
'"\xg"' \ '"z\xg1"' \
'"\x1g"' \ '"z\xg"' \
'"z\x"' \
'"\x1g"' \ '"\x1g"' \
; do ; do
printf '%s' "x: split=$badesc" > "$TEST_INDEXSCRIPT" printf '%s' "x: split=$badesc" > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex_error "bad hex digit in escape: '$badesc'" \
rc=0 "$TEST_INDEXSCRIPT:1:14: error: Bad hex digit in escaping"
out=`$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" < /dev/null 2>&1` || rc=$?
if [ $rc -eq 0 ] ; then
echo "scriptindex didn't exit with non-zero return code on bad escaping"
failed=`expr $failed + 1`
elif printf '%s' "$out" \
| grep -q ":1:14: error: Bad escaping in quoted action argument" ; then
: # OK
else
echo "scriptindex didn't give expected error for bad escaping"
printf '%s\n' "badesc=$badesc" "got: $out"
failed=`expr $failed + 1`
fi
done done
# Regression test that a closing " with junk after is flagged. # Regression test that a closing " with junk after is flagged.
printf 'date : field="test"index' > "$TEST_INDEXSCRIPT" printf 'date : field="test"index' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex_error "junk after closing quote" \
rc=0 "$TEST_INDEXSCRIPT:1:20: error: Unexpected character 'i' after closing quote"
out=`$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" < /dev/null 2>&1` || rc=$?
if [ $rc -eq 0 ] ; then
echo "scriptindex didn't exit with non-zero return code for junk after closi
ng quote"
failed=`expr $failed + 1`
elif printf '%s' "$out" \
| grep -q ":1:20: error: Unexpected character 'i' after closing quote" ; the
n
: # OK
else
echo "scriptindex didn't give expected error for junk after closing quote"
failed=`expr $failed + 1`
fi
# Test we warn about useless actions. # Test we warn about useless actions.
printf 'date : field parsedate=%%Y%%m%%d' > "$TEST_INDEXSCRIPT" printf 'date : field parsedate=%%Y%%m%%d' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex_warning "useless 'parsedate'" \
if $SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" < /dev/null 2>&1 \ "$TEST_INDEXSCRIPT:1:14: warning: Index action 'parsedate' has no effect*"
| grep -q ":1:14: warning: Index action 'parsedate' has no effect" ; then
: # OK # Test a `parsedate` format error.
else printf 'date : parsedate="%%Y\t%%m\t%%d\t%%Z" field' > "$TEST_INDEXSCRIPT"
echo "scriptindex didn't give expected warning for useless 'parsedate'" test_scriptindex_error "'%Z' in 'parsedate' format" \
failed=`expr $failed + 1` "$TEST_INDEXSCRIPT:1:28: error: Parsing timezone names with %Z is not supporte
fi d"
# Test scriptindex `gap` action inserts a termpos gap. # Test scriptindex `gap` action inserts a termpos gap.
printf 'text : index gap=5' > "$TEST_INDEXSCRIPT" printf 'text : index gap=5' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex 'GAP action' \
printf 'text=%s\n' foo bar baz|$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /de 'text=foo\ntext=bar\ntext=baz'
v/null
echo '|$hitlist{$id|}' > "$TEST_TEMPLATE" echo '|$hitlist{$id|}' > "$TEST_TEMPLATE"
testcase '|' 'P="foo bar"' testcase '|' 'P="foo bar"'
testcase '|' 'P=foo NEAR/5 bar' testcase '|' 'P=foo NEAR/5 bar'
testcase '|' 'P=foo NEAR/11 baz' testcase '|' 'P=foo NEAR/11 baz'
testcase '|1|' 'P=foo NEAR/6 bar' testcase '|1|' 'P=foo NEAR/6 bar'
testcase '|1|' 'P=foo NEAR/12 baz' testcase '|1|' 'P=foo NEAR/12 baz'
# The scriptindex `hash` action should require its argument is >= 6, so test 5 # The scriptindex `hash` action should require its argument is >= 6, so test 5
# is rejected. # is rejected.
printf 'url : hash=5 boolean=Q unique=Q' > "$TEST_INDEXSCRIPT" printf 'url : hash=5 boolean=Q unique=Q' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex_error 'bad HASH argument' \
if $SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" < /dev/null > /dev/null 2>&1 ; th "$TEST_INDEXSCRIPT:1:12: error: Index action 'hash' takes an integer argument
en which must be at least 6"
echo "scriptindex didn't reject 'hash=5'"
failed=`expr $failed + 1`
fi
# And that 6 is accepted. # And that 6 is accepted.
printf 'url : hash=6 boolean=Q unique=Q' > "$TEST_INDEXSCRIPT" printf 'url : hash=6 boolean=Q unique=Q' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex 'hash=6' \
if echo 'url=http://xapian.org' | $SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > 'url=http://xapian.org'
/dev/null 2>&1 ; then
: # OK
else
echo "scriptindex rejected 'hash=6'"
failed=`expr $failed + 1`
fi
# Regression test to check `hash` works without argument (it was failing with # Regression test to check `hash` works without argument (it was failing with
# an assertion in unreleased versions prior to 1.4.6). # an assertion in unreleased versions prior to 1.4.6).
printf 'url : hash boolean=Q unique=Q' > "$TEST_INDEXSCRIPT" printf 'url : hash boolean=Q unique=Q' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex 'HASH without argument' \
if echo 'url=http://xapian.org' | $SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > 'url=http://xapian.org'
/dev/null 2>&1 ; then
: # OK
else
echo "scriptindex rejected 'hash'"
failed=`expr $failed + 1`
fi
# Test the same actions for multiple fields works (briefly broken in git master # Test the same actions for multiple fields works (briefly broken in git master
# before 1.5.0). # before 1.5.0).
printf 'tag1 tag2 tag3 : boolean=T field' > "$TEST_INDEXSCRIPT" printf 'tag1 tag2 tag3 : boolean=T field' > "$TEST_INDEXSCRIPT"
rm -rf "$TEST_DB" test_scriptindex 'multiple fields on an action line' \
$SCRIPTINDEX "$TEST_DB" "$TEST_INDEXSCRIPT" > /dev/null <<'END' 'tag1=one\ntag2=two\ntag3=three'
tag1=one
tag2=two
tag3=three
END
printf '$hitlist{$list{$terms{T},|}/$field{tag1}|$field{tag2}|$field{tag3}}' > " $TEST_TEMPLATE" printf '$hitlist{$list{$terms{T},|}/$field{tag1}|$field{tag2}|$field{tag3}}' > " $TEST_TEMPLATE"
testcase 'Tone/one|two|three' B=Tone testcase 'Tone/one|two|three' B=Tone
testcase 'Tthree|Ttwo/one|two|three' B=Ttwo B=Tthree testcase 'Tthree|Ttwo/one|two|three' B=Ttwo B=Tthree
rm "$OMEGA_CONFIG_FILE" "$TEST_INDEXSCRIPT" "$TEST_TEMPLATE" rm "$OMEGA_CONFIG_FILE" "$TEST_INDEXSCRIPT" "$TEST_TEMPLATE"
rm -rf "$TEST_DB" rm -rf "$TEST_DB"
if [ "$failed" = 0 ] ; then if [ "$failed" = 0 ] ; then
exit 0 exit 0
fi fi
echo "Failed $failed test(s)" echo "Failed $failed test(s)"
 End of changes. 65 change blocks. 
369 lines changed or deleted 374 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)