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.20 -r1.1.2.21 --- openacs-4/packages/acs-templating/tcl/test/data-procs.tcl 30 Jun 2021 07:08:16 -0000 1.1.2.20 +++ openacs-4/packages/acs-templating/tcl/test/data-procs.tcl 30 Jun 2021 07:47:51 -0000 1.1.2.21 @@ -486,6 +486,43 @@ } } +aa_register_case -cats { + api + smoke + production_safe +} -procs { + template::data::validate + template::data::validate::textdate +} validate_textdate { + Test validation for textdate data types + + @author Héctor Romojaro + @creation-date 30 June 2021 +} { + # + # An textdate is a date in ISO YYYY-MM-DD. + # + set textdate_true { + 2021-06-30 + "" + } + set textdate_false { + 21-06-30 + 2021-13-30 + 2021-00-30 + 2021-06-32 + 2021-06-00 + "lala" + } + set message "" + foreach value $textdate_true { + aa_true "Is $value a textdate?" [template::data::validate textdate value message] + } + foreach value $textdate_false { + aa_false "Is $value a textdate?" [template::data::validate textdate value message] + } +} + # Local variables: # mode: tcl # tcl-indent-level: 4