Index: openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl 23 Sep 2003 08:24:50 -0000 1.8 +++ openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl 23 Sep 2003 09:19:44 -0000 1.9 @@ -371,3 +371,43 @@ aa_log "Text version: $text_version" } } + +aa_register_case ad_page_contract_filters { + Test ad_page_contract_filters +} { + set filter integer + foreach { value result } { "1" 1 "a" 0 "1.2" 0 "'" 0 } { + if { $result } { + aa_true "$value is $filter" [ad_page_contract_filter_invoke $filter dummy value] + } else { + aa_false "$value is NOT $filter" [ad_page_contract_filter_invoke $filter dummy value] + } + } + + set filter naturalnum + foreach { value result } { "1" 1 "-1" 0 "a" 0 "1.2" 0 "'" 0 } { + if { $result } { + aa_true "$value is $filter" [ad_page_contract_filter_invoke $filter dummy value] + } else { + aa_false "$value is NOT $filter" [ad_page_contract_filter_invoke $filter dummy value] + } + } + + set filter html + foreach { value result } { "'" 1 "
" 1 } { + if { $result } { + aa_true "$value is $filter" [ad_page_contract_filter_invoke $filter dummy value] + } else { + aa_false "$value is NOT $filter" [ad_page_contract_filter_invoke $filter dummy value] + } + } + + set filter nohtml + foreach { value result } { "a" 1 "
" 0 } { + if { $result } { + aa_true "$value is $filter" [ad_page_contract_filter_invoke $filter dummy value] + } else { + aa_false "$value is NOT $filter" [ad_page_contract_filter_invoke $filter dummy value] + } + } +}