Index: openacs-4/packages/xowf/tcl/test/xowf-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/tcl/test/xowf-test-procs.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/xowf/tcl/test/xowf-test-procs.tcl 31 Jul 2018 11:54:01 -0000 1.10 +++ openacs-4/packages/xowf/tcl/test/xowf-test-procs.tcl 7 Oct 2018 11:39:58 -0000 1.11 @@ -222,6 +222,35 @@ } } + + + aa_register_case -cats {api} -procs { + "::xowf::WorkflowConstruct instproc get_value" + } workflow_constructs { + + Test behavour of conditional and non-conditional expressions + of WorkflowConstructs. + + } { + + ::xowf::WorkflowConstruct instforward true set "" 1 + ::xowf::WorkflowConstruct instforward false set "" 0 + + ::xowf::WorkflowConstruct x + + aa_equals "non-conditional test with empty" [x get_value ""] "" + aa_equals "non-conditional test with non-empty scalar" [x get_value "a"] "a" + + aa_equals "non-conditional test with non-empty list" [x get_value {a b}] "a b" + aa_equals "non-conditional test with non-empty list" [x get_value "a b"] "a b" + + aa_equals "conditional test, true branch" [x get_value "? true a default b"] "a" + aa_equals "conditional test, false branch" [x get_value "? false a default b"] "b" + + aa_equals "conditional test, true branch list" [x get_value "? true {a b} default {b c}"] "a b" + aa_equals "conditional test, false branch list" [x get_value "? false {a b} default {b c}"] "b c" + } + } #