Index: openacs-4/packages/acs-tcl/tcl/test/html-conversion-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/html-conversion-procs.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/acs-tcl/tcl/test/html-conversion-procs.tcl 22 Jul 2018 09:58:43 -0000 1.17 +++ openacs-4/packages/acs-tcl/tcl/test/html-conversion-procs.tcl 25 Jul 2018 13:42:48 -0000 1.18 @@ -6,22 +6,25 @@ } -aa_register_case -cats {api smoke} ad_html_to_text_bold { +aa_register_case \ + -cats {api smoke} \ + -procs {ad_html_to_text} \ + ad_html_to_text_bold { Test if it converts b tags correctly. } { - set html "Some bold test" - set result [ad_html_to_text -- $html] - aa_true "contains asterisks?" [regexp {\*bold\*} $result] - } -aa_register_case -cats {api smoke} -bugs 386 -error_level warning \ +aa_register_case \ + -cats {api smoke} \ + -bugs 386 \ + -error_level warning \ + -procs {ad_html_to_text} \ ad_html_to_text_clipped_link { Test if it converts clipped links. @@ -49,29 +52,34 @@ } -aa_register_case -cats {api smoke} ad_html_security_check_href_allowed { +aa_register_case \ + -cats {api smoke} \ + -procs {ad_html_security_check} \ + ad_html_security_check_href_allowed { tests is href attribute is allowed of A tags } { set html "An Link" - aa_true "href is allowed for A tags" [string equal [ad_html_security_check $html] ""] + aa_equals "href is allowed for A tags" [ad_html_security_check $html] "" } -aa_register_case -cats {api smoke} util_close_html_tags { +aa_register_case \ + -cats {api smoke} \ + -procs {util_close_html_tags} \ + util_close_html_tags { Tests closing HTML tags. } { aa_equals "" [util_close_html_tags "Foobar"] "Foobar" - aa_equals "" [util_close_html_tags "Foobar"] "Foobar" - aa_equals "" [util_close_html_tags "Foobar is a very long word"] "Foobar is a very long word" - aa_equals "" [util_close_html_tags "Foobar is a very long word" 15] "Foobar is a" - aa_equals "" [util_close_html_tags "Foobar is a very long word" 0 20 "..."] "Foobar is a very..." } -aa_register_case -cats {api smoke} ad_html_text_convert { +aa_register_case \ + -cats {api smoke} \ + -procs {ad_html_text_convert ad_enhanced_text_to_html} \ + ad_html_text_convert { Testing ad_html_text_convert. } { #---------------------------------------------------------------------- @@ -90,7 +98,7 @@ # from text/markdown #---------------------------------------------------------------------- - if {[expr ![catch {package present Markdown}]]} { + if {![catch {package present Markdown}]} { set string "What?\n*Never mind, buddy*" aa_equals "" [ad_html_text_convert -from "text/markdown" -to "text/html" -truncate_len 14 -- $string] \ @@ -138,11 +146,21 @@ "What?\n_Never..." set long_string [string repeat "Very long text. " 10] - aa_equals "No truncation" [ad_html_text_convert -from "text/html" -to "text/html" -truncate_len [string length $long_string] -- $long_string] $long_string + aa_equals "No truncation" \ + [ad_html_text_convert \ + -from "text/html" \ + -to "text/html" \ + -truncate_len [string length $long_string] \ + -- \ + $long_string] \ + $long_string } -aa_register_case -cats {api smoke} string_truncate { +aa_register_case \ + -cats {api smoke} \ + -procs {string_truncate} \ + string_truncate { Testing string truncation } { aa_equals "" [string_truncate -len 5 -ellipsis "" -- "foo"] "foo" @@ -173,10 +191,13 @@ set long_string [string repeat "Very long text. " 100] aa_equals "No truncation" [string_truncate -len [string length $long_string] -- $long_string] $long_string - } -aa_register_case -cats {api smoke} -procs {util_convert_line_breaks_to_html} util_convert_line_breaks_to_html { + +aa_register_case \ + -cats {api smoke} \ + -procs {util_convert_line_breaks_to_html} \ + util_convert_line_breaks_to_html { Test if it converts spaces and line breaks correctly. } { #Convert leading and trailing spaces or tabs @@ -205,7 +226,10 @@ } -aa_register_case -cats {api smoke} -procs {ad_quotehtml ad_unquotehtml} quote_unquote_html { +aa_register_case \ + -cats {api smoke} \ + -procs {ad_unquotehtml} \ + quote_unquote_html { Test if it quote and unquote html } { #quote html @@ -218,10 +242,13 @@ set html $result aa_log "Quote html=$html" set result [ad_unquotehtml $html] - aa_true "Unquote html=$result" [string equal "\"<&text>\"" $result] + aa_equals "Unquote html=$result" "\"<&text>\"" $result } -aa_register_case -cats {api smoke} -procs {ad_looks_like_html_p} ad_looks_like_html_p { +aa_register_case \ + -cats {api smoke} \ + -procs {ad_looks_like_html_p} \ + ad_looks_like_html_p { Test if it guess the text supplied is html } { set html "Home Page" @@ -237,16 +264,22 @@ aa_true "Is html text" [ad_looks_like_html_p $html] } -aa_register_case -cats {api smoke} -procs {util_remove_html_tags} util_remove_html_tags { +aa_register_case \ + -cats {api smoke} \ + -procs {util_remove_html_tags} \ + util_remove_html_tags { Test if it remove all between tags } { set html "
some text to probe if it