summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2016-07-05 20:07:01 (GMT)
committerfvogel <fvogelnew1@free.fr>2016-07-05 20:07:01 (GMT)
commit5718d28895a5ea6c26d0dc5e8421b3ff31fe7785 (patch)
tree3719b3e24332dce60dbd180100a335fb503e72c9 /tests
parent77f55a8fc19b9564340f53bc04e96c0217bf24a9 (diff)
downloadtk-5718d28895a5ea6c26d0dc5e8421b3ff31fe7785.zip
tk-5718d28895a5ea6c26d0dc5e8421b3ff31fe7785.tar.gz
tk-5718d28895a5ea6c26d0dc5e8421b3ff31fe7785.tar.bz2
Added more tests, and fixed test result of text-27.26 since now indices are relative to the text widget state at undo/redo return time, and also because they are optimized (no overlaps)
Diffstat (limited to 'tests')
-rw-r--r--tests/text.test42
1 files changed, 36 insertions, 6 deletions
diff --git a/tests/text.test b/tests/text.test
index a3f9afe..65c3225 100644
--- a/tests/text.test
+++ b/tests/text.test
@@ -6601,12 +6601,42 @@ test text-27.26 {edit undo and edit redo return ranges} -setup {
lappend res [.t edit redo]
} -cleanup {
destroy .t
-} -result [list {2.0 2.19 1.6 1.12 1.6 2.0} \
- {1.6 2.0 1.6 1.12 2.0 2.19} \
- {1.9 1.10 1.9 1.10 1.6 1.7} \
- {1.6 1.7 1.9 1.10 1.9 1.10} \
- {2.8 2.26 2.8 2.12 1.6 1.12 1.6 1.10} \
- {1.6 1.10 1.6 1.12 2.8 2.12 2.8 2.26} ]
+} -result [list {1.6 2.0} \
+ {1.6 2.19} \
+ {1.6 1.7 1.10 1.12} \
+ {1.6 1.7 1.9 1.11} \
+ {1.6 1.16 2.8 2.19} \
+ {1.6 1.16 2.8 2.30} ]
+test text-27.27 {edit undo and edit redo return ranges} -setup {
+ destroy .t
+ set res {}
+} -body {
+ text .t -undo true -autoseparators false
+ for {set i 3} {$i >= 1} {incr i -1} {
+ .t insert 1.0 "Line $i\n"
+ }
+ lappend res [.t edit undo]
+ lappend res [.t edit redo]
+} -cleanup {
+ destroy .t
+} -result [list {1.0 2.0} \
+ {1.0 4.0} ]
+test text-27.28 {edit undo and edit redo do not leave \
+ spurious temporary marks behind them} -setup {
+ destroy .t
+ set res {}
+} -body {
+ pack [text .t -undo true -autoseparators false]
+ .t insert end "Hello World.\n"
+ .t edit separator
+ .t insert end "Again hello.\n"
+ .t edit undo
+ lappend res [lsearch [.t mark names] tk::undoMark*]
+ .t edit undo
+ lappend res [lsearch [.t mark names] tk::undoMark*]
+} -cleanup {
+ destroy .t
+} -result [list -1 -1]
test text-28.1 {bug fix - 624372, ControlUtfProc long lines} -body {