]> gitweb.factorcode.org Git - factor.git/commitdiff
add more advanced lookaround tests
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 22 Sep 2008 20:14:45 +0000 (15:14 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 22 Sep 2008 20:14:45 +0000 (15:14 -0500)
basis/regexp/regexp-tests.factor

index be19c065f5235f9d35c29d760c20685c6620f64a..934b635e507a200aa105a2e44602c084178e81f2 100644 (file)
@@ -306,3 +306,19 @@ IN: regexp-tests
 
 ! "a(?<!b)" <regexp> "baz" over first-match
 ! "a(?<!b)" <regexp> "caz" over first-match
+
+! "a(?=bcdefg)bcd" <regexp> "abcdefg" over first-match
+! "a(?#bcdefg)bcd" <regexp> "abcdefg" over first-match
+! "a(?:bcdefg)" <regexp> "abcdefg" over first-match
+
+[ { 0 1 } ] [ "ac" "a(?!b)" <regexp> first-match ] unit-test
+[ f ] [ "ab" "a(?!b)" <regexp> first-match ] unit-test
+
+! "a(?<=b)" <regexp> "caba" over first-match
+
+[ { 0 1 } ] [ "ab" "a(?=b)(?=b)" <regexp> first-match ] unit-test
+[ { 1 2 } ] [ "ba" "a(?<=b)(?<=b)" <regexp> first-match ] unit-test
+
+
+[ { 1 2 } ] [ "cab" "a(?=b)(?<=c)" <regexp> first-match ] unit-test
+