diff options
author | ericm <ericm@noemail.net> | 2000-04-10 21:08:25 (GMT) |
---|---|---|
committer | ericm <ericm@noemail.net> | 2000-04-10 21:08:25 (GMT) |
commit | ff0fab7b16e7b6e8afc6ac8e9412cbd899c3d23a (patch) | |
tree | 969dd778b3f00ae92ec0793ad12d2fb87496794c /tests | |
parent | 827e24b3436dc0af025b4b369bb3993efc71c210 (diff) | |
download | tcl-ff0fab7b16e7b6e8afc6ac8e9412cbd899c3d23a.zip tcl-ff0fab7b16e7b6e8afc6ac8e9412cbd899c3d23a.tar.gz tcl-ff0fab7b16e7b6e8afc6ac8e9412cbd899c3d23a.tar.bz2 |
* win/tclWinPipe.c (TclpCreateTempFile): Added conversion of
contents string from UTF to native encoding [Bug: 4030].
* tests/regexp.test: Added tests for infinite looping in [regexp -all].
* generic/tclCmdMZ.c: Fixed infinite loop bug with [regexp -all] [Bug: 4981].
FossilOrigin-Name: 1908ebdc39b71cc7648c9ccca12713c005201b83
Diffstat (limited to 'tests')
-rw-r--r-- | tests/regexp.test | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/regexp.test b/tests/regexp.test index dfbfd38..e891b54 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.12 2000/04/10 17:19:03 ericm Exp $ +# RCS: @(#) $Id: regexp.test,v 1.13 2000/04/10 21:08:27 ericm Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -503,6 +503,29 @@ test regexp-18.6 {regexp -all -inline} { test regexp-18.7 {regexp -all -inline} { list [catch {regexp -all -inline b abc match} msg] $msg } {1 {regexp match variables not allowed when using -inline}} +test regexp-18.8 {regexp -all} { + # This should not cause an infinite loop + regexp -all -inline {a*} a +} {a} +test regexp-18.9 {regexp -all} { + # Yes, the expected result is {a {}}. Here's why: + # Start at index 0; a* matches the "a" there then stops. + # Go to index 1; a* matches the lambda (or {}) there then stops. Recall + # that a* matches zero or more "a"'s; thus it matches the string "b", as + # there are zero or more "a"'s there. + # Go to index 2; this is past the end of the string, so stop. + regexp -all -inline {a*} ab +} {a {}} +test regexp-18.10 {regexp -all} { + # Yes, the expected result is {a {} a}. Here's why: + # Start at index 0; a* matches the "a" there then stops. + # Go to index 1; a* matches the lambda (or {}) there then stops. Recall + # that a* matches zero or more "a"'s; thus it matches the string "b", as + # there are zero or more "a"'s there. + # Go to index 2; a* matches the "a" there then stops. + # Go to index 3; this is past the end of the string, so stop. + regexp -all -inline {a*} aba +} {a {} a} # cleanup ::tcltest::cleanupTests |