aboutsummaryrefslogtreecommitdiff
path: root/tests/regexp2.test
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2020-04-18 09:34:25 +1000
committerSteve Bennett <steveb@workware.net.au>2020-05-04 21:57:34 +1000
commitda82368c816c8d06f425aa3f25a2a918fdba1df1 (patch)
treee1dc05358910d168edc982ed05523d0b30ad24d5 /tests/regexp2.test
parent8a5861eb51c32e41d638181188c256c1dbb93c96 (diff)
downloadjimtcl-da82368c816c8d06f425aa3f25a2a918fdba1df1.zip
jimtcl-da82368c816c8d06f425aa3f25a2a918fdba1df1.tar.gz
jimtcl-da82368c816c8d06f425aa3f25a2a918fdba1df1.tar.bz2
tests: Add many new additional tests for code coverage
readdir, tty, utf8, signal, alarm, kill, file, jimsh, posix, aio, history, interp, pack, unpack, eventloop, exec, load, package, regexp, regsub Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests/regexp2.test')
-rw-r--r--tests/regexp2.test27
1 files changed, 22 insertions, 5 deletions
diff --git a/tests/regexp2.test b/tests/regexp2.test
index 1aee8cd..936224d 100644
--- a/tests/regexp2.test
+++ b/tests/regexp2.test
@@ -494,6 +494,15 @@ test regexpComp-10.3 {newline sensitivity in regsub} {
# list [regsub -linestop {a.*b} "da\nbaxyb\nxb" 123 foo] $foo
# }
#} "1 {da\nb123\nxb}"
+test regexpComp-10.6 {\Z only matching end of string with -line} {
+ evalInProc {
+ set foo xxx
+ list [regsub -line {^a.*b\Z} "dabc\ncaxyb\naxb" 123 foo] $foo
+ }
+} "1 {dabc\ncaxyb\n123}"
+test regexpComp-10.7 {\A only matching beginning of string with -line} {
+ regexp -all -inline -line {\Aab.} abc\nabd
+} {abc}
test regexpComp-11.1 {regsub errors} {
evalInProc {
@@ -622,11 +631,11 @@ test regexpComp-16.3 {regsub -start} {
catch {unset x}
list [regsub -all -start 3 {z} hello {/&} x] $x
} {0 hello}
-#test regexpComp-16.4 {regsub -start, \A behavior} {
-# set out {}
-# lappend out [regsub -start 0 -all {\A(\w)} {abcde} {/\1} x] $x
-# lappend out [regsub -start 2 -all {\A(\w)} {abcde} {/\1} x] $x
-#} {5 /a/b/c/d/e 3 ab/c/d/e}
+test regexpComp-16.4 {regsub -start, \A behavior} tcl {
+ set out {}
+ lappend out [regsub -start 0 -all {\A(\w)} {abcde} {/\1} x] $x
+ lappend out [regsub -start 2 -all {\A(\w)} {abcde} {/\1} x] $x
+} {5 /a/b/c/d/e 3 ab/c/d/e}
test regexpComp-16.5 {regexp -start with utf8} utf8 {
regexp -inline -start 1 . \u0442\u0435\u0441\u0442
} \u0435
@@ -634,6 +643,14 @@ test regexpComp-16.6 {regexp -start with utf8} utf8 {
regsub -start 1 . \u0442\u0435\u0441\u0442 x
} \u0442x\u0441\u0442
+test regexpComp-16.7 {regexp -start with \A} {
+ regsub -start 1 {\Aabc} deabc -
+} {deabc}
+
+test regexpComp-16.7 {regexp -start with \A} {
+ regsub -start 1 {\Aabc} dabc -
+} {d-}
+
test regexpComp-17.1 {regexp -inline} {
regexp -inline b ababa
} {b}