_tsearch2-driver__build_query_tcl (private)

 _tsearch2-driver__build_query_tcl

Defined in packages/tsearch2-driver/tcl/test/tsearch2-driver-procs.tcl

Partial Call Graph (max 5 caller/called nodes):
%3 aa_equals aa_equals (public) aa_log aa_log (public) aa_log_result aa_log_result (public) aa_run_with_teardown aa_run_with_teardown (public) tsearch2::build_query_tcl tsearch2::build_query_tcl (public) _tsearch2-driver__build_query_tcl _tsearch2-driver__build_query_tcl _tsearch2-driver__build_query_tcl->aa_equals _tsearch2-driver__build_query_tcl->aa_log _tsearch2-driver__build_query_tcl->aa_log_result _tsearch2-driver__build_query_tcl->aa_run_with_teardown _tsearch2-driver__build_query_tcl->tsearch2::build_query_tcl

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
    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_tcl -query $q]
        aa_equals "Multiple terms automatic AND"  "$query" "openacs & test & automated"

        set q "openacs test not automated"
        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_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_tcl -query $q]
        aa_equals "Multiple terms grouped"  "$query" "(openacs & test) | automated"

        set q "(openacs or test) automated"
        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_tcl -query $q]
        aa_equals "Single letter elements" "$query" "one & a & two"

        set q "or else"
        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_tcl -query $q]
        aa_equals "Not all alone" "$query" ""

        set q "openacs and"
        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_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_tcl -query $q]
        aa_equals "AND and OR at the end of the query" "$query" "openacs & or"

    }
}} {
          aa_log "Running testcase body $body_count"
          set ::__aa_test_indent [info level]
          set catch_val [catch $testcase_body msg]
          if {$catch_val != 0 && $catch_val != 2} {
              aa_log_result "fail" "build_query_tcl (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo"
          }
          incr body_count
        }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: