diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/regexp2.test | 16 | ||||
-rw-r--r-- | tests/stringmatch.test | 12 |
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/regexp2.test b/tests/regexp2.test index 571c981..c3db17d 100644 --- a/tests/regexp2.test +++ b/tests/regexp2.test @@ -943,4 +943,20 @@ test regexp-25.3 {End of word} { regexp {\mcd\M} cdef } 0 +test regexp-26.1 {regexp operator =~} { + expr {"abc" =~ "^a"} +} 1 + +test regexp-26.2 {regexp operator =~} { + expr {"abc" =~ "^b"} +} 0 + +test regexp-26.2 {regexp operator =~} { + expr {"abc" =~ ".b."} +} 1 + +test regexp-26.3 {regexp operator =~ invalid regexp} -body { + expr {"abc" =~ {[}} +} -returnCodes error -result {couldn't compile regular expression pattern: brackets [] not balanced} + testreport diff --git a/tests/stringmatch.test b/tests/stringmatch.test index f0eab2a..c15acd1 100644 --- a/tests/stringmatch.test +++ b/tests/stringmatch.test @@ -230,4 +230,16 @@ test stringmatch-7.4 {null in pattern} { string match *b\[\0a\]r* foobar } 1 +test stringmatch-8.1 {string match operator =*} { + expr {"abc" =* "a*"} +} 1 + +test stringmatch-8.2 {string match operator =*} { + expr {"abc" =* "b*"} +} 0 + +test stringmatch-8.3 {string match operator =*} { + expr {"abc" =* {*[bB]c}} +} 1 + testreport |