diff options
author | vincentdarley <vincentdarley> | 2005-10-10 10:36:34 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley> | 2005-10-10 10:36:34 (GMT) |
commit | 465cf308ea2f63fa388ed9e0e055c82e8e9e3ca3 (patch) | |
tree | ce21d5eee20f7e5c9a628e238ad0a87a0aaeebad /tests/text.test | |
parent | ebaf2538558086d8a3749809e5863e1b134f19ab (diff) | |
download | tk-465cf308ea2f63fa388ed9e0e055c82e8e9e3ca3.zip tk-465cf308ea2f63fa388ed9e0e055c82e8e9e3ca3.tar.gz tk-465cf308ea2f63fa388ed9e0e055c82e8e9e3ca3.tar.bz2 |
tip256 implementation
Diffstat (limited to 'tests/text.test')
-rw-r--r-- | tests/text.test | 67 |
1 files changed, 65 insertions, 2 deletions
diff --git a/tests/text.test b/tests/text.test index e25e71b..17c9488 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.39 2005/08/23 23:04:42 dkf Exp $ +# RCS: @(#) $Id: text.test,v 1.40 2005/10/10 10:36:35 vincentdarley Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -86,6 +86,7 @@ foreach test { {-spacing3 -10 0 bogus} {-state d disabled foo} {-tabs {1i 2i 3i 4i} {1i 2i 3i 4i} bad_tabs} + {-tabstyle wordprocessor wordprocessor garbage} {-undo 1 1 eh} {-width 73 73 2.4} {-wrap w word bad_wrap} @@ -115,7 +116,7 @@ test text-1.[incr i] {text options} { lappend result [lindex $i 4] } set result -} {1 blue {} {} 0 7 watch {} 0 {} fixed #012 5 #123 #234 0 #ffff01234567 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}} +} {1 blue {} {} 0 7 watch {} 0 {} fixed #012 5 #123 #234 0 #ffff01234567 green 45 100 47 2 5 3 82 raised #ffff01234567 21 yellow 0 0 0 0 {} disabled {1i 2i 3i 4i} wordprocessor {any old thing} 1 73 word {x scroll command} {test command}} test text-2.1 {Tk_TextCmd procedure} { list [catch {text} msg] $msg @@ -1805,6 +1806,13 @@ test text-20.78.5 {TextSearchCmd, hidden text inside match must count in length} list [.t2 search -strict -all -count foo foar 1.3] $foo } {{2.0 3.0} {6 4}} +test text-20.78.6 {TextSearchCmd, single line with -all} { + deleteWindows + pack [text .t2] + .t2 insert end " X\n X\n X\n X\n X\n X\n" + .t2 search -all -regexp { +| *\n} 1.0 end +} {1.0 1.2 2.0 2.2 3.0 3.2 4.0 4.2 5.0 5.2 6.0 6.2 7.0} + test text-20.79 {TextSearchCmd, multiline matching} { deleteWindows pack [text .t2] @@ -2828,6 +2836,61 @@ test text-20.185 {TextSearchCmd, elide up to match} { lappend res [.t2 search -regexp c 1.0] } {{} {} 1.0 2.1 2.0 3.1 2.0 3.0} +test text-20.186 {TextSearchCmd, strict limits} { + deleteWindows + pack [text .t2] + .t2 insert 1.0 "Hello world!\nThis is a test\n" + .t2 search -strictlimits -- "world" 1.3 1.8 +} {} + +test text-20.187 {TextSearchCmd, strict limits} { + deleteWindows + pack [text .t2] + .t2 insert 1.0 "Hello world!\nThis is a test\n" + .t2 search -strictlimits -- "world" 1.3 1.10 +} {} + +test text-20.188 {TextSearchCmd, strict limits} { + deleteWindows + pack [text .t2] + .t2 insert 1.0 "Hello world!\nThis is a test\n" + .t2 search -strictlimits -- "world" 1.3 1.11 +} {1.6} + +test text-20.1189 {TextSearchCmd, strict limits backwards} { + deleteWindows + pack [text .t2] + .t2 insert 1.0 "Hello world!\nThis is a test\n" + .t2 search -strictlimits -backward -- "world" 2.3 1.8 +} {} + +test text-20.190 {TextSearchCmd, strict limits backwards} { + deleteWindows + pack [text .t2] + .t2 insert 1.0 "Hello world!\nThis is a test\n" + .t2 search -strictlimits -backward -- "world" 2.3 1.6 +} {1.6} + +test text-20.191 {TextSearchCmd, strict limits backwards} { + deleteWindows + pack [text .t2] + .t2 insert 1.0 "Hello world!\nThis is a test\n" + .t2 search -strictlimits -backward -- "world" 2.3 1.7 +} {} + +test text-20.188 {TextSearchCmd, strict limits} { + deleteWindows + pack [text .t2] + .t2 insert 1.0 "Hello world!\nThis is a test\n" + .t2 search -regexp -strictlimits -- "world" 1.3 1.8 +} {} + +test text-20.189 {TextSearchCmd, strict limits} { + deleteWindows + pack [text .t2] + .t2 insert 1.0 "Hello world!\nThis is a test\n" + .t2 search -regexp -strictlimits -backward -- "world" 2.3 1.8 +} {} deleteWindows text .t2 -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100 |