summaryrefslogtreecommitdiffstats
path: root/tests/ttk
diff options
context:
space:
mode:
authorjenglish <jenglish@noemail.net>2016-01-25 20:39:31 (GMT)
committerjenglish <jenglish@noemail.net>2016-01-25 20:39:31 (GMT)
commitc6536a8c6d0bf92828e1c1acf3ca2a3ce6a0d340 (patch)
treee8914babfcb2e9e1e915ef0391a1929360939051 /tests/ttk
parentb4b97b3ce56291f4baf2867835a6a88c6ddc86cb (diff)
downloadtk-c6536a8c6d0bf92828e1c1acf3ca2a3ce6a0d340.zip
tk-c6536a8c6d0bf92828e1c1acf3ca2a3ce6a0d340.tar.gz
tk-c6536a8c6d0bf92828e1c1acf3ca2a3ce6a0d340.tar.bz2
NotebookAddCommand: fix off-by-one error counting objc/objv
when readding an already-managed window with arguments. Bug reported on tcl-core by Sam Bromley (22 Jan 2016) FossilOrigin-Name: a5f78b26f8611931e30d72e28fcbf8211bd28c34
Diffstat (limited to 'tests/ttk')
-rw-r--r--tests/ttk/notebook.test21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ttk/notebook.test b/tests/ttk/notebook.test
index cdce020..3a2a6ff 100644
--- a/tests/ttk/notebook.test
+++ b/tests/ttk/notebook.test
@@ -468,6 +468,27 @@ test notebook-1817596-3 "insert/configure" -body {
} -result [list [list .nb.l2 .nb.l0 .nb.l1] L2 L0 L1] -cleanup { destroy .nb }
+test notebook-readd-1 "add same widget twice" -body {
+ pack [ttk::notebook .nb]
+ .nb add [ttk::button .nb.b1] -text "Button"
+ .nb add .nb.b1
+ .nb tabs
+} -result [list .nb.b1] -cleanup { destroy .nb }
+
+test notebook-readd-2 "add same widget twice, with options" -body {
+ pack [ttk::notebook .nb]
+ .nb add [ttk::button .nb.b1] -text "Tab label"
+ .nb add .nb.b1 -text "Changed tab label"
+ .nb tabs
+} -result [list .nb.b1] -cleanup { destroy .nb }
+
+test notebook-readd-3 "insert same widget twice, with options" -body {
+ pack [ttk::notebook .nb]
+ .nb insert end [ttk::button .nb.b1] -text "Tab label"
+ .nb insert end .nb.b1 -text "Changed tab label"
+ .nb tabs
+} -result [list .nb.b1] -cleanup { destroy .nb }
+
# See #1343984
test notebook-1343984-1 "don't autoselect on destroy - setup" -body {