summaryrefslogtreecommitdiffstats
path: root/tests/text.test
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-06-21 23:09:53 (GMT)
committerhobbs <hobbs>2002-06-21 23:09:53 (GMT)
commita0edbf3ca6fa387b4197db27447f16b9c4bb58ab (patch)
tree454006e4ff105b7ca979593a68e8dc7ea1cd12f4 /tests/text.test
parentdd3ada4cac8079dae041786afcc06b495e1b9354 (diff)
downloadtk-a0edbf3ca6fa387b4197db27447f16b9c4bb58ab.zip
tk-a0edbf3ca6fa387b4197db27447f16b9c4bb58ab.tar.gz
tk-a0edbf3ca6fa387b4197db27447f16b9c4bb58ab.tar.bz2
* doc/text.n: TIP #104 implementation which generalizes the
* generic/tkText.c: undo/redo stack to not be tied solely to the * generic/tkText.h: text widget. The APIs are still private. * generic/tkUndo.c: This also adds a stack limiting ability and * generic/tkUndo.h: a -maxundo option to the text widget (in * library/text.tcl: addition to the options from TIP #26) should * mac/tkMacDefault.h: users want to limit the undo/redo stack * tests/text.test: (should not be necessary in most cases). * unix/Makefile.in: [Patch #554763] (callewart) * unix/tkUnixDefault.h: * win/Makefile.in: * win/makefile.vc: * win/tkWinDefault.h:
Diffstat (limited to 'tests/text.test')
-rw-r--r--tests/text.test18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/text.test b/tests/text.test
index cddc199..c65c7fb 100644
--- a/tests/text.test
+++ b/tests/text.test
@@ -6,7 +6,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: text.test,v 1.14 2001/11/13 00:19:05 hobbs Exp $
+# RCS: @(#) $Id: text.test,v 1.15 2002/06/21 23:09:53 hobbs Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
source [file join [pwd] [file dirname [info script]] defs.tcl]
@@ -70,6 +70,7 @@ foreach test {
{-insertofftime 100 100 2.4}
{-insertontime 47 47 e1}
{-insertwidth 2.3 2 47d}
+ {-maxundo 5 5 noway}
{-padx 3.4 3 2.4.}
{-pady 82 82 bogus}
{-relief raised raised bumpy}
@@ -113,7 +114,7 @@ test text-1.[incr i] {text options} {
lappend result [lindex $i 4]
}
set result
-} {1 blue {} {} 7 watch 0 {} fixed #012 5 #123 #234 0 green 45 100 47 2 3 82 raised #ffff01234567 21 yellow 0 0 0 0 disabled {1i 2i 3i 4i} {any old thing} 1 73 word {x scroll command} {test command}}
+} {1 blue {} {} 7 watch 0 {} fixed #012 5 #123 #234 0 green 45 100 47 2 5 3 82 raised #ffff01234567 21 yellow 0 0 0 0 disabled {1i 2i 3i 4i} {any old thing} 1 73 word {x scroll command} {test command}}
test text-2.1 {Tk_TextCmd procedure} {
list [catch {text} msg] $msg
@@ -1481,6 +1482,19 @@ test text-25.12 {<<Selection>> virtual event} {
set ::retval
} {selection_changed}
+test text-25.13 {-maxundo configuration option} {
+ catch {destroy .t}
+ text .t -undo 1 -autoseparators 1 -maxundo 2
+ pack .t
+ .t insert end "line 1\n"
+ .t delete 1.4 1.6
+ .t insert end "line 2\n"
+ catch {.t edit undo}
+ catch {.t edit undo}
+ catch {.t edit undo}
+ .t get 1.0 end
+} "line 1\n\n"
+
eval destroy [winfo child .]
option clear