summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--tests/regexp.test14
2 files changed, 19 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d83e595..b3614d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-09-21 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/regexp.test: Added check for error message from
+ unbalanced [] in regexp. Added additional simple test cases
+ of basic regsub command.
+
2009-09-21 Don Porter <dgp@users.sourceforge.net>
* generic/tclCompile.c: Correct botch in the conversion of
diff --git a/tests/regexp.test b/tests/regexp.test
index c4b4cab..2fe87b9 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.33 2008/08/21 23:19:51 hobbs Exp $
+# RCS: @(#) $Id: regexp.test,v 1.34 2009/09/21 21:30:41 mdejong Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -246,6 +246,9 @@ test regexp-6.8 {regexp errors} {
test regexp-6.9 {regexp errors, -start bad int check} {
list [catch {regexp -start bogus {^$} {}} msg] $msg
} {1 {bad index "bogus": must be integer?[+-]integer? or end?[+-]integer?}}
+test regexp-6.10 {regexp errors} {
+ list [catch {regexp {a[} b} msg] $msg
+} {1 {couldn't compile regular expression pattern: brackets [] not balanced}}
test regexp-7.1 {basic regsub operation} {
list [regsub aa+ xaxaaaxaa 111&222 foo] $foo
@@ -305,6 +308,15 @@ test regexp-7.17 {regsub utf compliance} {
regsub a\u4e4eb xyza\u4e4ebijka\u4e4ebpqr 555 bar
list [string compare $foo $bar] [regexp 4 $bar]
} {0 0}
+test regexp-7.18 {basic regsub replacement} {
+ list [regsub a+ aaa {&} foo] $foo
+} {1 aaa}
+test regexp-7.19 {basic regsub backslash replacement} {
+ list [regsub a+ aaa {\0} foo] $foo
+} {1 aaa}
+test regexp-7.20 {basic regsub backslash replacement} {
+ list [regsub a+ aaa {\\\0} foo] $foo
+} {1 {\aaa}}
test regexp-8.1 {case conversion in regsub} {
list [regsub -nocase a(a+) xaAAaAAay & foo] $foo