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.9 -r1.1.2.10 --- openacs-4/packages/acs-templating/tcl/test/data-procs.tcl 28 Jun 2021 10:16:31 -0000 1.1.2.9 +++ openacs-4/packages/acs-templating/tcl/test/data-procs.tcl 28 Jun 2021 10:30:16 -0000 1.1.2.10 @@ -256,6 +256,33 @@ } } +aa_register_case -cats { + api + smoke + production_safe +} -procs { + template::data::validate + template::data::validate::filename +} validate_filename { + Test validation for filename data types + + @author Héctor Romojaro + @creation-date 28 June 2021 +} { + # + # Currently, filename must be alphanumeric, "-" or "_". + # + set filename_true {0 1 lala lala_la_la lala-la-la -yes -} + set filename_false {not,valid ,no . "la la la" la.la} + set message "" + foreach value $filename_true { + aa_true "Is $value a filename?" [template::data::validate filename value message] + } + foreach value $filename_false { + aa_false "Is $value a filename?" [template::data::validate filename value message] + } +} + # Local variables: # mode: tcl # tcl-indent-level: 4