Index: openacs-4/packages/tsearch2-driver/tcl/test/tsearch2-driver-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tsearch2-driver/tcl/test/tsearch2-driver-procs.tcl,v diff -u -N -r1.5.2.7 -r1.5.2.8 --- openacs-4/packages/tsearch2-driver/tcl/test/tsearch2-driver-procs.tcl 25 Feb 2021 14:26:55 -0000 1.5.2.7 +++ openacs-4/packages/tsearch2-driver/tcl/test/tsearch2-driver-procs.tcl 25 Feb 2021 15:05:29 -0000 1.5.2.8 @@ -3,6 +3,7 @@ Tests for tsearch2-driver @author Dave Bauer (dave@thedesignexperience.org) + @author Héctor Romojaro @creation-date 2005-03-07 @cvs-id $Id$ } @@ -11,68 +12,62 @@ api production_safe } -procs { - tsearch2::build_query -} build_query { - build_query test + tsearch2::build_query_tcl +} build_query_tcl { + build_query_tcl test } { aa_run_with_teardown -test_code { # some tests to see if we can turn the english query into # something tsearch2 to_tsquery can handle set q "openacs test automated" - set query [tsearch2::build_query -query $q] - aa_true "Multiple terms automatic AND '$query'" \ - {"openacs & test & automated" eq $query} + set query [tsearch2::build_query_tcl -query $q] + aa_equals "Multiple terms automatic AND" \ + "$query" "openacs & test & automated" set q "openacs test not automated" - set query [tsearch2::build_query -query $q] - aa_true "Multiple terms automatic AND, explicit NOT '$query'" \ - {"openacs & test & ! automated" eq $query} + set query [tsearch2::build_query_tcl -query $q] + aa_equals "Multiple terms automatic AND, explicit NOT" \ + "$query" "openacs & test & ! automated" set q "openacs test or automated" - set query [tsearch2::build_query -query $q] - aa_true "Multiple terms automatic AND, explicit OR '$query'" \ - {"openacs & test | automated" eq $query} + set query [tsearch2::build_query_tcl -query $q] + aa_equals "Multiple terms automatic AND, explicit OR" \ + "$query" "openacs & test | automated" set q "(openacs test) or automated" - set query [tsearch2::build_query -query $q] - aa_true "Multiple terms grouped '$query'" \ - {"(openacs & test) | automated" eq $query} + set query [tsearch2::build_query_tcl -query $q] + aa_equals "Multiple terms grouped" \ + "$query" "(openacs & test) | automated" set q "(openacs or test) automated" - set query [tsearch2::build_query -query $q] - aa_true "Multiple terms grouped automatic AND '$query'" \ - {"(openacs | test) & automated" eq $query} + set query [tsearch2::build_query_tcl -query $q] + aa_equals "Multiple terms grouped automatic AND" \ + "$query" "(openacs | test) & automated" set q "one a two" - set query [tsearch2::build_query -query $q] - aa_true "Single letter elements '$query'" \ - {"one & a & two" eq $query} + set query [tsearch2::build_query_tcl -query $q] + aa_equals "Single letter elements" "$query" "one & a & two" set q "or else" - set query [tsearch2::build_query -query $q] - aa_true "Or at beginning by itself '$query'" \ - {"else" eq $query} + set query [tsearch2::build_query_tcl -query $q] + aa_equals "Or at beginning by itself" "$query" "else" set q "not" - set query [tsearch2::build_query -query $q] - aa_true "Not all alone '$query'" \ - {"" eq $query} + set query [tsearch2::build_query_tcl -query $q] + aa_equals "Not all alone" "$query" "" set q "openacs and" - set query [tsearch2::build_query -query $q] - aa_true "AND at the end of the query '$query'" \ - {"openacs & and" eq $query} + set query [tsearch2::build_query_tcl -query $q] + aa_equals "AND at the end of the query" "$query" "openacs & and" set q "openacs or" - set query [tsearch2::build_query -query $q] - aa_true "OR at the end of the query '$query'" \ - {"openacs & or" eq $query} + set query [tsearch2::build_query_tcl -query $q] + aa_equals "OR at the end of the query" "$query" "openacs & or" set q "openacs and or" - set query [tsearch2::build_query -query $q] - aa_true "AND and OR at the end of the query '$query'" \ - {"openacs & or" eq $query} + set query [tsearch2::build_query_tcl -query $q] + aa_equals "AND and OR at the end of the query" "$query" "openacs & or" } }