Index: openacs-4/packages/acs-templating/tcl/test/data-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/test/data-procs.tcl,v diff -u -r1.1.2.11 -r1.1.2.12 --- openacs-4/packages/acs-templating/tcl/test/data-procs.tcl 28 Jun 2021 10:35:48 -0000 1.1.2.11 +++ openacs-4/packages/acs-templating/tcl/test/data-procs.tcl 28 Jun 2021 10:41:20 -0000 1.1.2.12 @@ -318,6 +318,44 @@ } } +aa_register_case -cats { + api + smoke + production_safe +} -procs { + template::data::validate + template::data::validate::url_element +} validate_url_element { + Test validation for url_element data types + + @author Héctor Romojaro + @creation-date 28 June 2021 +} { + # + # URL elements may only contain lowercase characters, numbers and hyphens. + # + set url_element_true { + lalala + 0 + -1 + -asdasaf + } + set url_element_false { + LALALA + NO + "la la" + not,valid + :// + } + set message "" + foreach value $url_element_true { + aa_true "Is $value a url_element?" [template::data::validate url_element value message] + } + foreach value $url_element_false { + aa_false "Is $value a url_element?" [template::data::validate url_element value message] + } +} + # Local variables: # mode: tcl # tcl-indent-level: 4