From 001b7826bc62aa0a183d382821d42f0789f7d8e4 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 22 Sep 2008 15:14:45 -0500 Subject: [PATCH] add more advanced lookaround tests --- basis/regexp/regexp-tests.factor | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/basis/regexp/regexp-tests.factor b/basis/regexp/regexp-tests.factor index be19c065f5..934b635e50 100644 --- a/basis/regexp/regexp-tests.factor +++ b/basis/regexp/regexp-tests.factor @@ -306,3 +306,19 @@ IN: regexp-tests ! "a(? "baz" over first-match ! "a(? "caz" over first-match + +! "a(?=bcdefg)bcd" "abcdefg" over first-match +! "a(?#bcdefg)bcd" "abcdefg" over first-match +! "a(?:bcdefg)" "abcdefg" over first-match + +[ { 0 1 } ] [ "ac" "a(?!b)" first-match ] unit-test +[ f ] [ "ab" "a(?!b)" first-match ] unit-test + +! "a(?<=b)" "caba" over first-match + +[ { 0 1 } ] [ "ab" "a(?=b)(?=b)" first-match ] unit-test +[ { 1 2 } ] [ "ba" "a(?<=b)(?<=b)" first-match ] unit-test + + +[ { 1 2 } ] [ "cab" "a(?=b)(?<=c)" first-match ] unit-test +