diff options
author | ericm <ericm> | 2000-07-25 00:05:40 (GMT) |
---|---|---|
committer | ericm <ericm> | 2000-07-25 00:05:40 (GMT) |
commit | c6bc600d803dbcb3b90be56c4653c52add4ba9b3 (patch) | |
tree | 29db30b6a07a41cbf1c7cbac313ba0defcbf7d1d /tests/text.test | |
parent | 5649a675dfb76712afa08a8711459fc263bdbeb3 (diff) | |
download | tk-c6bc600d803dbcb3b90be56c4653c52add4ba9b3.zip tk-c6bc600d803dbcb3b90be56c4653c52add4ba9b3.tar.gz tk-c6bc600d803dbcb3b90be56c4653c52add4ba9b3.tar.bz2 |
* tests/text.test: Added tests for -regexp -nocase searches with
backslash character classes.
* generic/tkText.c (TextSearchCmd): Text search did not work
properly when -regexp and -nocase were used, in combination with
backslash character classes represented by capital letters (ie,
\W, \M); altered implementation of -regexp -nocase searches to use
new regexp interfaces to fix this problem. [Bug: 5988].
Diffstat (limited to 'tests/text.test')
-rw-r--r-- | tests/text.test | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/tests/text.test b/tests/text.test index 1d3a7bd..5e676dd 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.11 2000/07/21 23:44:12 ericm Exp $ +# RCS: @(#) $Id: text.test,v 1.12 2000/07/25 00:05:40 ericm Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { source [file join [pwd] [file dirname [info script]] defs.tcl] @@ -1139,6 +1139,30 @@ test text-20.69 {TextSearchCmd, hidden text does not affect match index} { .t2 search boo 1.0 } 3.3 +test text-20.70 {TextSearchCmd, -regexp -nocase searches} { + catch {destroy .t} + pack [text .t] + .t insert end "word1 word2" + set res [.t search -nocase -regexp {\mword.} 1.0 end] + destroy .t + set res +} 1.0 +test text-20.71 {TextSearchCmd, -regexp -nocase searches} { + catch {destroy .t} + pack [text .t] + .t insert end "word1 word2" + set res [.t search -nocase -regexp {word.\M} 1.0 end] + destroy .t + set res +} 1.0 +test text-20.72 {TextSearchCmd, -regexp -nocase searches} { + catch {destroy .t} + pack [text .t] + .t insert end "word1 word2" + set res [.t search -nocase -regexp {word.\W} 1.0 end] + destroy .t + set res +} 1.0 eval destroy [winfo child .] text .t2 -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100 |