diff options
author | hobbs <hobbs> | 2002-02-07 00:52:25 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2002-02-07 00:52:25 (GMT) |
commit | ab7b0d2ecb6a3cdf49109bf456aa0df5fb6369cb (patch) | |
tree | 25a443e710d5a7ddfd6fe69706d1da810938bf17 | |
parent | 38ee0e28deb314012071b8b1d34e088b202e7a60 (diff) | |
download | tcl-ab7b0d2ecb6a3cdf49109bf456aa0df5fb6369cb.zip tcl-ab7b0d2ecb6a3cdf49109bf456aa0df5fb6369cb.tar.gz tcl-ab7b0d2ecb6a3cdf49109bf456aa0df5fb6369cb.tar.bz2 |
extra code coverage cases
-rw-r--r-- | tests/regexp.test | 5 | ||||
-rw-r--r-- | tests/regexpComp.test | 43 |
2 files changed, 37 insertions, 11 deletions
diff --git a/tests/regexp.test b/tests/regexp.test index e19f771..3e06061 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.17 2001/09/19 18:09:02 hobbs Exp $ +# RCS: @(#) $Id: regexp.test,v 1.18 2002/02/07 00:52:25 hobbs Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -546,6 +546,9 @@ test regexp-20.1 {regsub shared object shimmering} { regsub $a $c $b d list $d [string length $d] [string bytelength $d] } [list abcdefghijklmnopqurstuvwxyz0123456789 37 37] +test regexp-20.2 {regsub shared object shimmering with -about} { + eval regexp -about abc +} {0 {}} # cleanup ::tcltest::cleanupTests diff --git a/tests/regexpComp.test b/tests/regexpComp.test index 1a4de0f..1bb73eb 100644 --- a/tests/regexpComp.test +++ b/tests/regexpComp.test @@ -708,25 +708,38 @@ test regexp-18.10 {regexp -all} { regexp -all -inline {a*} aba } {a {} a} test regexp-18.11 {regexp -all} { - regexp -all -inline {^a} aaaa + evalInProc { + regexp -all -inline {^a} aaaa + } } {a} test regexp-18.12 {regexp -all -inline -indices} { - regexp -all -inline -indices a(b(c)d|e(f)g)h abcdhaefgh + evalInProc { + regexp -all -inline -indices a(b(c)d|e(f)g)h abcdhaefgh + } } {{0 4} {1 3} {2 2} {-1 -1} {5 9} {6 8} {-1 -1} {7 7}} test regexp-19.1 {regsub null replacement} { - regsub -all {@} {@hel@lo@} "\0a\0" result - list $result [string length $result] + evalInProc { + regsub -all {@} {@hel@lo@} "\0a\0" result + list $result [string length $result] + } } "\0a\0hel\0a\0lo\0a\0 14" test regexp-20.1 {regsub shared object shimmering} { - # Bug #461322 - set a abcdefghijklmnopqurstuvwxyz - set b $a - set c abcdefghijklmnopqurstuvwxyz0123456789 - regsub $a $c $b d - list $d [string length $d] [string bytelength $d] + evalInProc { + # Bug #461322 + set a abcdefghijklmnopqurstuvwxyz + set b $a + set c abcdefghijklmnopqurstuvwxyz0123456789 + regsub $a $c $b d + list $d [string length $d] [string bytelength $d] + } } [list abcdefghijklmnopqurstuvwxyz0123456789 37 37] +test regexp-20.2 {regsub shared object shimmering with -about} { + evalInProc { + eval regexp -about abc + } +} {0 {}} test regexp-21.1 {regexp command compiling tests} { evalInProc { @@ -774,6 +787,16 @@ test regexp-21.9 {regexp command compiling tests} { list [catch {regexp -- -nocase foo dogfod} msg] $msg } } {0 0} +test regexp-21.10 {regexp command compiling tests} { + evalInProc { + list [regsub -all "" foo bar str] $str + } +} {3 barfbarobaro} +test regexp-21.11 {regexp command compiling tests} { + evalInProc { + list [regsub -all "" "" bar str] $str + } +} {0 {}} # cleanup ::tcltest::cleanupTests |