diff options
author | hobbs <hobbs> | 2008-08-21 23:19:02 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2008-08-21 23:19:02 (GMT) |
commit | 4ad1d554a92681b3d78876608ad0671c76098978 (patch) | |
tree | a8fca5285c96617cf3657e31c0d1504d11f63f38 /tests | |
parent | a7d5eb42a94f26a9380e19ee52f52bf62c92cf50 (diff) | |
download | tcl-4ad1d554a92681b3d78876608ad0671c76098978.zip tcl-4ad1d554a92681b3d78876608ad0671c76098978.tar.gz tcl-4ad1d554a92681b3d78876608ad0671c76098978.tar.bz2 |
* tests/regexp.test, tests/regexpComp.test: correct re2glob ***=
* generic/tclUtil.c (TclReToGlob): translation from exact
to anywhere-in-string match. [Bug 2065115]
Diffstat (limited to 'tests')
-rw-r--r-- | tests/regexp.test | 27 | ||||
-rw-r--r-- | tests/regexpComp.test | 39 |
2 files changed, 64 insertions, 2 deletions
diff --git a/tests/regexp.test b/tests/regexp.test index 92b6c6a..295d83c 100644 --- a/tests/regexp.test +++ b/tests/regexp.test @@ -11,7 +11,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: regexp.test,v 1.30 2007/12/23 21:29:42 hobbs Exp $ +# RCS: @(#) $Id: regexp.test,v 1.30.2.1 2008/08/21 23:19:06 hobbs Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -44,6 +44,31 @@ test regexp-1.7 {regexp utf compliance} { list [string compare $foo $bar] [regexp 4 $bar] } {0 0} +test regexp-1.8 {regexp ***= metasyntax} { + regexp -- "***=o" "aeiou" +} 1 +test regexp-1.9 {regexp ***= metasyntax} { + set string "aeiou" + regexp -- "***=o" $string +} 1 +test regexp-1.10 {regexp ***= metasyntax} { + set string "aeiou" + set re "***=o" + regexp -- $re $string +} 1 +test regexp-1.11 {regexp ***= metasyntax} { + regexp -- "***=y" "aeiou" +} 0 +test regexp-1.12 {regexp ***= metasyntax} { + set string "aeiou" + regexp -- "***=y" $string +} 0 +test regexp-1.13 {regexp ***= metasyntax} { + set string "aeiou" + set re "***=y" + regexp -- $re $string +} 0 + test regexp-2.1 {getting substrings back from regexp} { set foo {} list [regexp ab*c abbbbc foo] $foo diff --git a/tests/regexpComp.test b/tests/regexpComp.test index c7a5980..f38062d 100644 --- a/tests/regexpComp.test +++ b/tests/regexpComp.test @@ -43,7 +43,7 @@ test regexpComp-1.2 {basic regexp operation} { } } 1 test regexpComp-1.3 {basic regexp operation} { - evalInProc { + evalInProc { regexp ab*c ab } } 0 @@ -69,6 +69,43 @@ test regexpComp-1.7 {regexp utf compliance} { } } {0 0} +test regexp-1.8 {regexp ***= metasyntax} { + evalInProc { + regexp -- "***=o" "aeiou" + } +} 1 +test regexp-1.9 {regexp ***= metasyntax} { + evalInProc { + set string "aeiou" + regexp -- "***=o" $string + } +} 1 +test regexp-1.10 {regexp ***= metasyntax} { + evalInProc { + set string "aeiou" + set re "***=o" + regexp -- $re $string + } +} 1 +test regexp-1.11 {regexp ***= metasyntax} { + evalInProc { + regexp -- "***=y" "aeiou" + } +} 0 +test regexp-1.12 {regexp ***= metasyntax} { + evalInProc { + set string "aeiou" + regexp -- "***=y" $string + } +} 0 +test regexp-1.13 {regexp ***= metasyntax} { + evalInProc { + set string "aeiou" + set re "***=y" + regexp -- $re $string + } +} 0 + test regexpComp-2.1 {getting substrings back from regexp} { evalInProc { set foo {} |