1 # vim: ft=tcl foldmethod=marker foldmarker=<<<,>>> ts=4 shiftwidth=4
3 if {[lsearch [namespace children] ::tcltest] == -1} {
4 package require tcltest 2.2.5
5 namespace import ::tcltest::*
10 test form_default_handling-1.1 {Check correct order of precedence with no default values, no _onchange} -body { #<<<
11 tlc::Form .f -name "form_default_handling-1.1" -schema {
12 "Foo" {foo radiogroup -choices {
17 "Bar" {bar checkbutton}
18 "History" {history entry}
21 .f set_data [dict create \
25 thing "Also updated" \
28 list [dict get $dat foo] [dict get $dat bar] [dict get $dat history] [dict get $dat thing]
30 if {[itcl::is object .f]} {delete object .f}
31 } -result [list option2 0 Updated "Also updated"]
33 test form_default_handling-1.2 {Check correct order of precedence with default values, no _onchange} -body { #<<<
34 tlc::Form .f -name "form default_handling-1.2" -schema {
35 "Foo" {foo radiogroup -choices {
40 "Bar" {bar checkbutton}
41 "History" {history entry}
50 .f set_data [dict create \
54 thing "Also updated" \
57 list [dict get $dat foo] [dict get $dat bar] [dict get $dat history] [dict get $dat thing]
59 if {[itcl::is object .f]} {delete object .f}
60 } -result [list option2 0 Updated "Also updated"]
63 ::tcltest::cleanupTests