Index: openacs-4/packages/xotcl-core/tcl/test/xotcl-core-db-tutorial-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/test/Attic/xotcl-core-db-tutorial-procs.tcl,v diff -u -N -r1.1.2.5 -r1.1.2.6 --- openacs-4/packages/xotcl-core/tcl/test/xotcl-core-db-tutorial-procs.tcl 26 Aug 2020 18:50:43 -0000 1.1.2.5 +++ openacs-4/packages/xotcl-core/tcl/test/xotcl-core-db-tutorial-procs.tcl 7 Feb 2021 18:45:38 -0000 1.1.2.6 @@ -3,7 +3,14 @@ } -aa_register_case -cats {api smoke db} xotcl_core_tutorial_1 { +aa_register_case -cats { + api smoke db +} -procs { + "::xo::db::Class instproc new_persistent_object" + "::xo::db::Class instproc get_instance_from_db" + "::xo::db::Class proc exists_in_db" + "::xo::db::Object instproc delete" +} xotcl_core_tutorial_1 { Basic test cases based on the XOTcl core tutorial, test case set (1): create/fetch/delete/destroy objects } { @@ -37,7 +44,18 @@ } } -aa_register_case -cats {api smoke db} xotcl_core_tutorial_2 { +aa_register_case -cats { + api smoke db +} -procs { + " Class ::xo::db::Attribute" + " Class ::xo::db::Class" + "::xo::db::Class instproc get_instance_from_db" + "::xo::db::Class instproc new_persistent_object" + "::xo::db::Class instproc create_object_type" + "::xo::db::Class proc exists_in_db" + "::xo::db::Class proc object_type_exists_in_db" + "::xo::db::Object instproc save" +} xotcl_core_tutorial_2 { Basic test cases based on the XOTcl core tutorial, test case set (2): Create new types from XOTcl objects } { @@ -138,7 +156,11 @@ } } -aa_register_case -cats {api smoke db} xotcl_core_tutorial_3 { +aa_register_case -cats { + api smoke db +} -procs { + "::xo::db::Class proc get_class_from_db" +} xotcl_core_tutorial_3 { Basic test cases based on the XOTcl core tutorial, test case set (3): create classes from DB } { @@ -173,7 +195,16 @@ } -aa_register_case -cats {api smoke db} xotcl_core_tutorial_4 { +aa_register_case -cats { + api smoke db +} -procs { + "::xo::db::Class proc object_type_exists_in_db" + "::xo::db::CrClass instproc create_object_type" + "::xo::db::CrClass instproc get_instance_from_db" + "::xo::db::CrClass proc lookup" + "::xo::db::CrItem instproc save" + "::xo::db::CrItem instproc save_new" +} xotcl_core_tutorial_4 { Basic test cases based on the XOTcl core tutorial, test case set (4): extending CR with application class } { Index: openacs-4/packages/xotcl-core/tcl/test/xotcl-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/test/Attic/xotcl-test-procs.tcl,v diff -u -N -r1.1.2.11 -r1.1.2.12 --- openacs-4/packages/xotcl-core/tcl/test/xotcl-test-procs.tcl 24 Apr 2019 12:33:57 -0000 1.1.2.11 +++ openacs-4/packages/xotcl-core/tcl/test/xotcl-test-procs.tcl 7 Feb 2021 18:45:38 -0000 1.1.2.12 @@ -3,7 +3,15 @@ } -aa_register_case -cats {api smoke} test_xo_db_object { +aa_register_case -cats { + api smoke +} -procs { + "::xo::db::Class proc get_instance_from_db" + "::xo::db::Object instproc save" + "::xo::db::Object instproc save_new" + "::xo::db::Object instproc delete" + "::xo::db::Class proc exists_in_db" +} test_xo_db_object { Test basic ::xo::db::Object ORM features } { aa_run_with_teardown -test_code { @@ -136,7 +144,15 @@ } } -aa_register_case -cats {api smoke} test_cr_items { +aa_register_case -cats { + api smoke +} -procs { + "::xo::db::CrClass proc get_instance_from_db" + "::xo::db::CrItem instproc save" + "::xo::db::CrItem instproc save_new" + "::xo::db::CrItem instproc delete" + "::xo::db::Class proc exists_in_db" +} test_cr_items { Test basic ::xo::db::CrItem ORM features } { aa_run_with_teardown -test_code { @@ -301,7 +317,37 @@ } } +aa_register_case -cats { + api smoke +} -procs { + "::xo::require_html_procs" + "::xo::db::list_to_values" + "::xo::db::tcl_date" +} test_misc_core { + Test various small xotcl-core functionalities. +} { + ::xo::require_html_procs + aa_true "html::a exists" {[info commands ::html::a] ne ""} + aa_equals "xo::db::list_to_values" [xo::db::list_to_values {1 2 3}] {(VALUES ('1'),('2'),('3'))} + + aa_equals "tcl_date from oracle" [::xo::db::tcl_date 2008-08-25 tz_var secfrac_var] 2008-08-25 + aa_equals "tcl_date from oracle TZ and secfrac" "$tz_var $secfrac_var" "00 0" + + aa_equals "tcl_date from PostgreSQL type ANSI format secfrac and TZ" \ + [::xo::db::tcl_date "2017-08-08 13:19:33.264032+02" tz_var secfrac_var] "2017-08-08 13:19:33" + aa_equals "tcl_date from PostgreSQL TZ and secfrac" "$tz_var $secfrac_var" "+02 264032" + + aa_equals "tcl_date from PostgreSQL type ANSI format secfrac no TC" \ + [::xo::db::tcl_date "2017-08-08 13:19:33.264032" tz_var secfrac_var] "2017-08-08 13:19:33" + aa_equals "tcl_date from PostgreSQL TZ and secfrac" "$tz_var $secfrac_var" "00 264032" + + aa_equals "tcl_date from PostgreSQL type ANSI format no TC" \ + [::xo::db::tcl_date "2017-08-08 13:19:33" tz_var secfrac_var] "2017-08-08 13:19:33" + aa_equals "tcl_date from PostgreSQL TZ and secfrac" "$tz_var $secfrac_var" "00 0" +} + + # Local variables: # mode: tcl # tcl-indent-level: 4