From b7706d3a1017135cf320a6d0fad0f4ce7753ecbc Mon Sep 17 00:00:00 2001 From: Stas Boukarev Date: Thu, 11 Apr 2013 14:06:37 +0400 Subject: [PATCH] Add a test-case which exercises a branch of end-string-aux. --- test/simple | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/simple b/test/simple index 69c3fe7..35f052f 100644 --- a/test/simple +++ b/test/simple @@ -347,3 +347,19 @@ characters if there's a match." for s = (create-scanner "(([a-c])+)x") always (equalp (multiple-value-list (scan s "abcxy")) (list 0 4 #(0 2) #(3 3)))) + +(labels ((char-code-odd-p (char) + (oddp (char-code char))) + (char-code-even-p (char) + (evenp (char-code char))) + (resolver (name) + (cond ((string= name "odd") #'char-code-odd-p) + ((string= name "even") #'char-code-even-p) + ((string= name "true") (constantly t)) + (t (error "Can't resolve ~S." name))))) + (equalp + (let ((*property-resolver* #'resolver)) + (list (regex-replace-all (create-scanner "\\p{odd}") "abcd" "+") + (regex-replace-all (create-scanner "\\p{even}") "abcd" "+") + (regex-replace-all (create-scanner "\\p{true}") "abcd" "+"))) + '("+b+d" "a+c+" "++++")))