aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2010-11-27 21:38:39 +1000
committerSteve Bennett <steveb@workware.net.au>2010-11-28 23:06:20 +1000
commit6c6a315bb5d422df3764d4bf508dc741ee4742bc (patch)
tree0289ce23afbde1f3e7544ab42b8957897dab544d /tests
parent60dfb023c4afa95047e0fa8db49830ccb46446b2 (diff)
downloadjimtcl-6c6a315bb5d422df3764d4bf508dc741ee4742bc.zip
jimtcl-6c6a315bb5d422df3764d4bf508dc741ee4742bc.tar.gz
jimtcl-6c6a315bb5d422df3764d4bf508dc741ee4742bc.tar.bz2
Bug fix: regexp should not treat \n as |
Remove a "feature" in the built-in regexp, where a newline in the pattern was treated as alternation, like |. Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests')
-rw-r--r--tests/regexp.test4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/regexp.test b/tests/regexp.test
index a198fc8..885e44c 100644
--- a/tests/regexp.test
+++ b/tests/regexp.test
@@ -640,6 +640,10 @@ test regexp-21.13 {multiple matches handle newlines} {
regexp -all -inline -indices -line -- ^ "a\nb\nc"
} {{0 -1} {2 1} {4 3}}
+test regexp-21.14 {Literal newline in pattern} {
+ regexp -all -inline "\n(\[ \t\]+)" "\n\t\t# This is a test"
+} "{\n\t\t} {\t\t}"
+
test regexp-22.1 {effect of caching} jim {
set filedata {BEGIN_TABLE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; END_TABLE}