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.3 -r1.1.2.4 --- openacs-4/packages/acs-templating/tcl/test/data-procs.tcl 28 Jun 2021 09:40:11 -0000 1.1.2.3 +++ openacs-4/packages/acs-templating/tcl/test/data-procs.tcl 28 Jun 2021 09:44:24 -0000 1.1.2.4 @@ -113,6 +113,31 @@ aa_false "Is $value a integer?" [template::data::validate integer value message] } } + +aa_register_case -cats { + api + smoke + production_safe +} -procs { + template::data::validate + template::data::validate::naturalnum +} validate_naturalnum { + Test validation for naturalnum data types + + @author Héctor Romojaro + @creation-date 28 June 2021 +} { + set nat_true {0 5 1 20 99999999999999999999999999999999999999999999999999999999999 08} + set nat_false {0.0 5,3 0,1 ,3 -1 -9.3} + set message "" + foreach value $nat_true { + aa_true "Is $value a naturalnum?" [template::data::validate naturalnum value message] + } + foreach value $nat_false { + aa_false "Is $value a naturalnum?" [template::data::validate naturalnum value message] + } +} + # Local variables: # mode: tcl # tcl-indent-level: 4