antoniop
committed
on 05 Sep 22
Use faster idiom to tell if a string is only space
openacs-4/.../www/admin/testcase.tcl (+2 -2)
79 79         break
80 80     }
81 81 }
82 82
83 83 set bug_list [list]
84 84 foreach bug $testcase_bugs {
85 85     set href [export_vars -base "http://openacs.org/bugtracker/openacs/bug" {{bug_number $bug}}]
86 86     lappend bug_list [subst {<a href="[ns_quotehtml $href]">$bug</a>}]
87 87 }
88 88 set bug_blurb [join $bug_list ", "]
89 89
90 90 #
91 91 # Split procs into direct and indirectly covered procs. These are
92 92 # separated by an empty line. if there is no empty line, then we
93 93 # assume all procs are directly tested.
94 94 #
95 95 set direct_testcase_procs ""
96 96 set indirect_testcase_procs ""
97 97 set var direct_testcase_procs
98 98 foreach line [split [string trim $testcase_procs] \n] {
99       if {[string trim $line] eq ""} {
  99     if {[string is space $line]} {
100 100         set var indirect_testcase_procs
101 101     } else {
102 102         append $var $line " "
103 103     }
104 104 }
105 105
106 106 set proc_list [list]
107 107 foreach p $direct_testcase_procs {
108 108     set href [export_vars -base "/api-doc/proc-view" { {proc $p} }]
109 109     lappend proc_list [subst {<a href="[ns_quotehtml $href]">$p</a>}]
110 110 }
111 111 set proc_blurb [join $proc_list ", "]
112 112 set nr_indirect_test_procs [llength $indirect_testcase_procs]
113 113
114 114 set url_list [list]
115 115 foreach url $testcase_urls {
116 116     set path packages/$package_key/www/$url.tcl
117 117     set href [export_vars -base "/api-doc/content-page-view" { path {source_p 1} }]
118 118     lappend url_list [subst {<a href="[ns_quotehtml $href]">$url</a>}]
119 119 }