Index: openacs-4/packages/acs-templating/tcl/test/data-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/test/Attic/data-procs.tcl,v diff -u -N -r1.1.2.10 -r1.1.2.11 --- openacs-4/packages/acs-templating/tcl/test/data-procs.tcl 28 Jun 2021 10:30:16 -0000 1.1.2.10 +++ openacs-4/packages/acs-templating/tcl/test/data-procs.tcl 28 Jun 2021 10:35:48 -0000 1.1.2.11 @@ -283,6 +283,41 @@ } } +aa_register_case -cats { + api + smoke + production_safe +} -procs { + template::data::validate + template::data::validate::url +} validate_url { + Test validation for url data types + + @author Héctor Romojaro + @creation-date 28 June 2021 +} { + set url_true { + http://la.la + https://la.la + https://a.a + no-protocol + /relative + } + set url_false { + not,valid + "la la la" + ftp://lala.la + https:// + } + set message "" + foreach value $url_true { + aa_true "Is $value a url?" [template::data::validate url value message] + } + foreach value $url_false { + aa_false "Is $value a url?" [template::data::validate url value message] + } +} + # Local variables: # mode: tcl # tcl-indent-level: 4