Skip to content

Commit 4e67769

Browse files
committed
ttk/notebook.test: move test setup statements in notebook-5.1 to a COMMON TEST SETUP section
1 parent cf11658 commit 4e67769

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

tests/ttk/notebook.test

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ inoperative test notebook-1.2 "Cannot add siblings" -body {
5656
test notebook-1.3 "Cannot add toplevel" -body {
5757
.nb add [toplevel .nb.t]
5858
} -cleanup {
59-
destroy .t.nb
59+
destroy .nb.t
6060
} -returnCodes error -result {cannot add ".nb.t" as content of ".nb"}
6161

6262
test notebook-1.4 "Try to select bad tab" -body {
@@ -123,13 +123,17 @@ test notebook-4.4 "-padding option" -body {
123123

124124
test notebook-4.end "Cleanup test suite 1-4.*" -body { destroy .nb }
125125

126-
test notebook-5.1 "Virtual events" -body {
127-
toplevel .t
128-
update
129-
set ::events [list]
130-
pack [set nb [ttk::notebook .t.nb]] -expand true -fill both; update
131-
bind .t <<NotebookTabChanged>> { lappend events changed %W }
126+
#
127+
# COMMON TEST SETUP
128+
#
129+
toplevel .t
130+
update
131+
set nb [ttk::notebook .t.nb]
132+
pack $nb -expand true -fill both; update
133+
bind .t <<NotebookTabChanged>> { lappend events changed %W }
132134

135+
test notebook-5.1 "Virtual events" -body {
136+
set events [list]
133137
$nb add [frame $nb.f1] ; # triggers <<NotebookTabChanged>> (first tab gets autoselected)
134138
$nb add [frame $nb.f2]
135139
$nb add [frame $nb.f3]

0 commit comments

Comments
 (0)