summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2003-06-17 20:36:19 (GMT)
committervincentdarley <vincentdarley>2003-06-17 20:36:19 (GMT)
commit40f784e5dd093138e64826cec42bd23e0f842f78 (patch)
tree98079f2944e00af30b4417532b30ad4cecc4a4f3 /tests
parent1268ac3113dd4f5b5627c98afd15addcf608875a (diff)
downloadtcl-40f784e5dd093138e64826cec42bd23e0f842f78.zip
tcl-40f784e5dd093138e64826cec42bd23e0f842f78.tar.gz
tcl-40f784e5dd093138e64826cec42bd23e0f842f78.tar.bz2
regsub empty string fixes, and windows build
Diffstat (limited to 'tests')
-rw-r--r--tests/regexp.test42
1 files changed, 41 insertions, 1 deletions
diff --git a/tests/regexp.test b/tests/regexp.test
index 2bb017e..e5b2bd8 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.22 2002/07/10 11:56:44 dgp Exp $
+# RCS: @(#) $Id: regexp.test,v 1.23 2003/06/17 20:36:20 vincentdarley Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -572,6 +572,46 @@ test regexp-20.2 {regsub shared object shimmering with -about} {
eval regexp -about abc
} {0 {}}
+test regexp-21.1 {regsub works with empty string} {
+ regsub -- ^ {} foo
+} {foo}
+
+test regexp-21.2 {regsub works with empty string} {
+ regsub -- \$ {} foo
+} {foo}
+
+test regexp-21.3 {regsub works with empty string offset} {
+ regsub -start 0 -- ^ {} foo
+} {foo}
+
+test regexp-21.4 {regsub works with empty string offset} {
+ regsub -start 0 -- \$ {} foo
+} {foo}
+
+test regexp-21.5 {regsub works with empty string offset} {
+ regsub -start 3 -- \$ {123} foo
+} {123foo}
+
+test regexp-21.6 {regexp works with empty string} {
+ regexp -- ^ {}
+} {1}
+
+test regexp-21.7 {regexp works with empty string} {
+ regexp -start 0 -- ^ {}
+} {1}
+
+test regexp-21.8 {regexp works with empty string offset} {
+ regexp -start 3 -- ^ {123}
+} {0}
+
+test regexp-21.9 {regexp works with empty string offset} {
+ regexp -start 3 -- \$ {123}
+} {1}
+
+test regexp-21.10 {multiple matches handle newlines} {
+ regsub -all -lineanchor -- {^#[^\n]*\n} "#one\n#two\n#three\n" foo\n
+} "foo\nfoo\nfoo\n"
+
# cleanup
::tcltest::cleanupTests
return