Index: openacs-4/packages/acs-subsite/tcl/test/acs-subsite-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/test/acs-subsite-procs.tcl,v diff -u -r1.12.2.24 -r1.12.2.25 --- openacs-4/packages/acs-subsite/tcl/test/acs-subsite-procs.tcl 1 Mar 2021 14:14:34 -0000 1.12.2.24 +++ openacs-4/packages/acs-subsite/tcl/test/acs-subsite-procs.tcl 1 Mar 2021 14:59:39 -0000 1.12.2.25 @@ -515,6 +515,55 @@ } } +aa_register_case -cats { + api + production_safe +} -procs { + attribute::translate_datatype + attribute::datatype_validator_exists_p +} acs_subsite_attribute_datatypes { + Test different attribute datatype procs + + @author Héctor Romojaro + @creation-date 01 March 2021 +} { + # + # Datatype validators + # + set datatype_validator { + boolean boolean + keyword keyword + integer integer + money integer + string string + text text + foo text + } + dict for {datatype validator} $datatype_validator { + aa_equals "Datatype $datatype" \ + [attribute::translate_datatype $datatype] "$validator" + } + # + # Explicit validator exists for datatype? + # + set datatype_validator_p { + enumeration 1 + boolean 1 + keyword 1 + integer 1 + string 1 + money 0 + date 0 + text 1 + foo 0 + } + dict for {datatype validator_p} $datatype_validator_p { + aa_equals "Datatype $datatype validator exists" \ + [attribute::datatype_validator_exists_p $datatype] "$validator_p" + } + +} + # Local variables: # mode: tcl # tcl-indent-level: 4