Index: openacs-4/packages/acs-api-browser/tcl/test/acs-api-browser-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/tcl/test/acs-api-browser-procs.tcl,v diff -u -N -r1.4.2.1 -r1.4.2.2 --- openacs-4/packages/acs-api-browser/tcl/test/acs-api-browser-procs.tcl 5 Sep 2019 15:08:19 -0000 1.4.2.1 +++ openacs-4/packages/acs-api-browser/tcl/test/acs-api-browser-procs.tcl 5 Sep 2019 15:24:57 -0000 1.4.2.2 @@ -66,6 +66,46 @@ nsv_unset -nocomplain -- $proc_name } +aa_register_case \ + -cats { api smoke } \ + -procs { + api_apropos_functions + } \ + acs_api_browser_api_apropos_functions { + Check api_apropos_functions + } { + set all_ad_procs [nsv_array names api_proc_doc] + + aa_true "Searching for the empty string returns every ad_proc" \ + {[llength [api_apropos_functions ""]] == [llength $all_ad_procs]} + + while {[set bogus_proc [ad_generate_random_string]] in $all_ad_procs} {} + aa_true "A bogus proc returns no result" \ + {[llength [api_apropos_functions $bogus_proc]] == 0} + + set proc ns_write + set found_p false + foreach r [api_apropos_functions $proc] { + lassign $r name etc + if {$name eq $proc} { + set found_p true + break + } + } + aa_false "Other non ad_* api is not returned" $found_p + + set proc api_apropos_functions + set found_p false + foreach r [api_apropos_functions $proc] { + lassign $r name etc + if {$name eq $proc} { + set found_p true + break + } + } + aa_true "This same proc is retrieved correctly" $found_p + } + # Local variables: # mode: tcl # tcl-indent-level: 4