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.2 -r1.1.2.3 --- openacs-4/packages/acs-templating/tcl/test/data-procs.tcl 25 Jun 2021 17:30:14 -0000 1.1.2.2 +++ openacs-4/packages/acs-templating/tcl/test/data-procs.tcl 28 Jun 2021 09:40:11 -0000 1.1.2.3 @@ -90,6 +90,29 @@ } } +aa_register_case -cats { + api + smoke + production_safe +} -procs { + template::data::validate + template::data::validate::integer +} validate_integer { + Test validation for integer data types + + @author Héctor Romojaro + @creation-date 28 June 2021 +} { + set int_true {0 -0 -5 1 20 99999999999999999999999999999999999999999999999999999999999} + set int_false {0.0 5,3 0,1 ,3} + set message "" + foreach value $int_true { + aa_true "Is $value a integer?" [template::data::validate integer value message] + } + foreach value $int_false { + aa_false "Is $value a integer?" [template::data::validate integer value message] + } +} # Local variables: # mode: tcl # tcl-indent-level: 4