Index: openacs-4/packages/xotcl-core/tcl/test/xotcl-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/test/xotcl-test-procs.tcl,v diff -u -r1.1.2.21 -r1.1.2.22 --- openacs-4/packages/xotcl-core/tcl/test/xotcl-test-procs.tcl 9 Jan 2023 10:52:27 -0000 1.1.2.21 +++ openacs-4/packages/xotcl-core/tcl/test/xotcl-test-procs.tcl 9 Jan 2023 16:48:24 -0000 1.1.2.22 @@ -377,6 +377,7 @@ api smoke } -procs { "::xo::dc 1row" + "::xo::dc foreach" } test_prepared_statements { Tests the ::xo::dc with respect to prepared statements. } { @@ -463,6 +464,34 @@ aa_equals "::xo::dc 1row with 1 parameter, prepared statement with SQL containing semicolon - value was returned" \ $object_id $object_id_found_7 + aa_false "::xo::dc foreach with 1 parameter - no error" [catch { + set l [list] + ::xo::dc foreach get_object { + select object_id + from acs_objects + where object_id = :object_id + } { + lappend l $object_id + } + }] + + aa_equals "::xo::dc foreach with 1 parameter - value was returned" \ + $l [list $object_id] + + aa_false "::xo::dc foreach with 1 parameter, prepared statement - no error" [catch { + set l2 [list] + ::xo::dc foreach -prepare integer get_object { + select object_id + from acs_objects + where object_id = :object_id + } { + lappend l2 $object_id + } + }] + + aa_equals "::xo::dc foreach with 1 parameter, prepared statement - value was returned" \ + $l2 [list $object_id] + }