daveb
committed
on 13 Nov 06
Bug#3039. Safely handle OR operator in query without a lefthand operand.
/test/tsearch2-driver-procs.tcl (+5 -2)
26 26             aa_true "Multiple terms automatic AND, explicit NOT '[tsearch2::build_query -query $q]'" \
27 27                 [string equal "openacs & test & ! automated" \
28 28                      [tsearch2::build_query -query $q]]
29 29             set q "openacs test or automated"
30 30             aa_true "Multiple terms automatic AND, explicit OR '[tsearch2::build_query -query $q]'" \
31 31                 [string equal "openacs & test | automated" \
32 32                      [tsearch2::build_query -query $q]]
33 33             set q "(openacs test) or automated"
34 34             aa_true "Multiple terms grouped '[tsearch2::build_query -query $q]'" \
35 35                 [string equal "(openacs & test) | automated" \
36 36                      [tsearch2::build_query -query $q]]
37 37             set q "(openacs or test) automated"
38 38             aa_true "Multiple terms grouped automatic AND '[tsearch2::build_query -query $q]'" \
39 39                 [string equal "(openacs | test) & automated" \
40 40                      [tsearch2::build_query -query $q]]
41 41             set q "one a two"
42 42             aa_true "Single letter elements" \
43 43                 [string equal "one & a & two" \
44 44                      [tsearch2::build_query -query $q]]
45 45
46  
  46             set q "or else"
  47             aa_true "Or at beginning by itself" \
  48                 [string equal "else" \
  49                      [tsearch2::build_query -query $q]]
47 50         }
48 51 }