summaryrefslogtreecommitdiffstats
path: root/tests/ttk/notebook.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ttk/notebook.test')
-rw-r--r--tests/ttk/notebook.test31
1 files changed, 29 insertions, 2 deletions
diff --git a/tests/ttk/notebook.test b/tests/ttk/notebook.test
index d4c5e4c..b07ed30 100644
--- a/tests/ttk/notebook.test
+++ b/tests/ttk/notebook.test
@@ -1,5 +1,5 @@
#
-# $Id: notebook.test,v 1.2 2007/06/09 21:45:45 jenglish Exp $
+# $Id: notebook.test,v 1.3 2007/10/25 22:52:42 jenglish Exp $
#
package require Tk 8.5
@@ -312,7 +312,6 @@ test notebook-6.11 "Hide a non-current tab > current" -setup {
lappend result [$nb index current] [winfo ismapped $nb.f2]
} -result [list 1 1 1 1]
-
#
# Insert:
#
@@ -427,4 +426,32 @@ test notebook-7.end "insert - cleanup" -body {
destroy .nb
}
+test notebook-1817596-1 "insert should autoselect first tab" -body {
+ pack [ttk::notebook .nb]
+ list \
+ [.nb insert end [ttk::label .nb.l1 -text One] -text One] \
+ [.nb select] \
+ ;
+} -result [list "" .nb.l1] -cleanup { destroy .nb }
+
+test notebook-1817596-2 "error in insert should have no effect" -body {
+ pack [ttk::notebook .nb]
+ .nb insert end [ttk::label .nb.l1]
+ .nb insert end [ttk::label .nb.l2]
+ list \
+ [catch { .nb insert .l2 0 -badoption badvalue } err] \
+ [.nb tabs] \
+} -result [list 1 [list .nb.l1 .nb.l2]] -cleanup { destroy .nb }
+
+test notebook-1817596-3 "insert/configure" -body {
+ pack [ttk::notebook .nb]
+ .nb insert end [ttk::label .nb.l0] -text "L0"
+ .nb insert end [ttk::label .nb.l1] -text "L1"
+ .nb insert end [ttk::label .nb.l2] -text "XX"
+ .nb insert 0 2 -text "L2"
+
+ list [.nb tabs] [.nb tab 0 -text] [.nb tab 1 -text] [.nb tab 2 -text]
+
+} -result [list [list .nb.l2 .nb.l0 .nb.l1] L2 L0 L1] -cleanup { destroy .nb }
+
tcltest::cleanupTests