_acs-tcl__documentation__check_parameters (private)
_acs-tcl__documentation__check_parameters
Defined in packages/acs-tcl/tcl/test/doc-check-procs.tcl
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set _aa_export {} set body_count 1 foreach testcase_body {{ set count 0 set good 0 set ignorechars { , " " ( " " ) " " < " " > " " \{ " " \} " " < " " > " " . " " : " " ; " " ? " " ! " " = " " \r " " \" " " „ " " “ " " ” " " " " "" } foreach p [lsort -dictionary [nsv_array names api_proc_doc]] { set param_unknown 0 set proc_doc [nsv_get api_proc_doc $p] set deprecated_p [expr {[dict exists $proc_doc deprecated_p] && [dict get $proc_doc deprecated_p]}] if {!$deprecated_p && [dict exists $proc_doc param]} { incr count set params [dict get $proc_doc param] # # Build the real parameters list # #ns_log notice "check args for '$p'" set real_params [list {*}[dict get $proc_doc switches0] {*}[dict get $proc_doc positionals] {*}[dict get $proc_doc switches1] ] # # Check if the last parameter is 'args', as it is not included into # 'switches' or 'positionals', and add it to the real parameter list # if {[dict get $proc_doc varargs_p]} { lappend real_params args } # # Check if the @param exists in the list of parameters # foreach param_doc $params { set param [lindex [string map $ignorechars $param_doc] 0] # Allow boolean parameter name with appended '_p' regsub -- _p$ $param "" param_trim_p if {$param ni $real_params && $param_trim_p ni $real_params} { # Nonexistent @param found! #ns_log notice "param_docs '$param_doc' real_params '$real_params'" incr param_unknown aa_log_result fail "Unknown parameter '$param' in documentation of proc '$p'" } } # Just count the number of procs without nonexistent @params if { $param_unknown == 0 } { incr good } } } aa_log "@param names seem coherent with the actual proc parameters in $good of $count checked procs" }} { 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" "documentation__check_parameters (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo" } incr body_count }XQL Not present: Generic, PostgreSQL, Oracle