summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorpspjuth <peter.spjuth@gmail.com>2016-08-30 20:01:23 (GMT)
committerpspjuth <peter.spjuth@gmail.com>2016-08-30 20:01:23 (GMT)
commitb237ee23c355f68d92dccd811aa8bfd6f1ceed05 (patch)
treeebb1720403a12bfde763e6def9d22620bbd370c8 /tests
parent6dff0d8b916b2f909061e9ffc615bb908f12d1b8 (diff)
parentbdab09a0d9b8ae500789e11038ce4a96802388ec (diff)
downloadtk-b237ee23c355f68d92dccd811aa8bfd6f1ceed05.zip
tk-b237ee23c355f68d92dccd811aa8bfd6f1ceed05.tar.gz
tk-b237ee23c355f68d92dccd811aa8bfd6f1ceed05.tar.bz2
Made text widget's default undo false again.
Diffstat (limited to 'tests')
-rw-r--r--tests/text.test56
1 files changed, 49 insertions, 7 deletions
diff --git a/tests/text.test b/tests/text.test
index b4a7a2b..79703e7 100644
--- a/tests/text.test
+++ b/tests/text.test
@@ -29,6 +29,15 @@ test text-1.1 {configuration option: "autoseparators"} -setup {
} -cleanup {
destroy .t
} -result {1}
+test text-1.1b {configuration option: "autoseparators", default} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t cget -autoseparators
+} -cleanup {
+ destroy .t
+} -result {1}
test text-1.2 {configuration option: "autoseparators"} -setup {
text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
pack .t
@@ -428,6 +437,15 @@ test text-1.43 {configuration option: "maxundo"} -setup {
} -cleanup {
destroy .t
} -result {5}
+test text-1.43b {configuration option: "maxundo", default} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t cget -maxundo
+} -cleanup {
+ destroy .t
+} -result {0}
test text-1.44 {configuration option: "maxundo"} -setup {
text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
pack .t
@@ -732,6 +750,15 @@ test text-1.75 {configuration option: "undo"} -setup {
} -cleanup {
destroy .t
} -result {1}
+test text-1.75b {configuration option: "undo", default} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t cget -undo
+} -cleanup {
+ destroy .t
+} -result {0}
test text-1.76 {configuration option: "undo"} -setup {
text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
pack .t
@@ -1459,16 +1486,16 @@ Line 7"
rename test.t .t
destroy .t
} -result [list {edit undo} {delete 2.1 2.4} {mark set insert 2.1} {see insert} \
- {mark set tk::undoMarkL3 2.1} {mark set tk::undoMarkR3 2.4} \
- {mark gravity tk::undoMarkL3 left} {mark gravity tk::undoMarkR3 right} \
- {insert 2.1 ef} {mark set insert 2.3} {see insert} \
- {mark set tk::undoMarkL2 2.1} {mark set tk::undoMarkR2 2.3} \
+ {mark set tk::undoMarkL2 2.1} {mark set tk::undoMarkR2 2.4} \
{mark gravity tk::undoMarkL2 left} {mark gravity tk::undoMarkR2 right} \
+ {insert 2.1 ef} {mark set insert 2.3} {see insert} \
+ {mark set tk::undoMarkL1 2.1} {mark set tk::undoMarkR1 2.3} \
+ {mark gravity tk::undoMarkL1 left} {mark gravity tk::undoMarkR1 right} \
{mark names} \
+ {index tk::undoMarkL1} {index tk::undoMarkR1} \
+ {mark unset tk::undoMarkL1 tk::undoMarkR1} \
{index tk::undoMarkL2} {index tk::undoMarkR2} \
{mark unset tk::undoMarkL2 tk::undoMarkR2} \
- {index tk::undoMarkL3} {index tk::undoMarkR3} \
- {mark unset tk::undoMarkL3 tk::undoMarkR3} \
{compare 2.1 > 2.3} {compare 2.6 > 2.3} ]
test text-8.23 {TextWidgetCmd procedure, "replace" option with undo} -setup {
@@ -6408,8 +6435,23 @@ test text-27.16a {undo configuration options with peers} -body {
lappend res [.t edit canundo]
lappend res [.tt edit canundo]
} -cleanup {
- destroy .t
+ destroy .t .tt
} -result {1 1 0 0 100 100 1 1}
+test text-27.16b {undo configuration options with peers, defaults} -body {
+ text .t
+ .t peer create .tt
+ set res [.t cget -undo]
+ lappend res [.tt cget -undo]
+ lappend res [.t cget -autoseparators]
+ lappend res [.tt cget -autoseparators]
+ lappend res [.t cget -maxundo]
+ lappend res [.tt cget -maxundo]
+ .t insert end "The undo stack is common between peers"
+ lappend res [.t edit canundo]
+ lappend res [.tt edit canundo]
+} -cleanup {
+ destroy .t .tt
+} -result {0 0 1 1 0 0 0 0}
test text-27.17 {bug fix 1536735 - undo with empty text} -body {
text .t -undo 1
set r [.t edit modified]