shithub: mc

Download patch

ref: 1c11729fff3d5d0c1689df73cd0bd8f58dd322d4
parent: dca73ed74ed162734e766a5e651ad1a6c9f74bb5
author: Ori Bernstein <[email protected]>
date: Tue Dec 17 17:41:38 EST 2013

Add tests for capturing expressions

--- /dev/null
+++ b/test/data/regex-capture-expected
@@ -1,0 +1,10 @@
+Matched. 2 matches
+match 0: Abc
+match 1: bc
+Matched. 2 matches
+match 0: Abcde
+match 1: bcd
+Matched. 3 matches
+match 0: Abcde
+match 1: bcd
+match 2: c
--- /dev/null
+++ b/test/regex-capture.myr
@@ -1,0 +1,7 @@
+use "testmatch.use"
+
+const main = {
+	testmatch("A(.*)", "Abc")
+	testmatch("A(.*)e", "Abcde")
+	testmatch("A(b(.*)d)e", "Abcde")
+}
--- a/test/tests
+++ b/test/tests
@@ -21,5 +21,6 @@
 #	What we compare with. This should be self-
 #	evident.
 B regex-basic		C
+B regex-capture         C
 B regex-failmatch	C
 B regex-unicode		C