From 0eecc81e6c3240ca5293ad960f772a579211b66b Mon Sep 17 00:00:00 2001 From: "Jesse A. Tov" Date: Thu, 25 Jul 2019 19:36:40 -0500 Subject: [PATCH] Demonstrates bug in char-complement. This commit adds 3 tests. All 3 should pass, but right now 2 of them fail because char-complement is considering (repetition n n e) to be a charset for *any* n, so long as e is a charset. --- br-parser-tools-lib/br-parser-tools/private-lex/stx.rkt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/br-parser-tools-lib/br-parser-tools/private-lex/stx.rkt b/br-parser-tools-lib/br-parser-tools/private-lex/stx.rkt index 7d887b1..16ee1d5 100644 --- a/br-parser-tools-lib/br-parser-tools/private-lex/stx.rkt +++ b/br-parser-tools-lib/br-parser-tools/private-lex/stx.rkt @@ -147,6 +147,7 @@ (check-equal? (char-set? '(repetition 1 2 #\1)) #f) (check-equal? (char-set? '(repetition 1 1 "12")) #f) (check-equal? (char-set? '(repetition 1 1 "1")) #t) + (check-equal? (char-set? '(repetition 6 6 "1")) #f) (check-equal? (char-set? '(union "1" "2" "3")) #t) (check-equal? (char-set? '(union "1" "" "3")) #f) (check-equal? (char-set? '(intersection "1" "2" (union "3" "4"))) #t) @@ -182,4 +183,8 @@ (check-equal? (parse #'(char-range #\1 "1") null) '(char-range #\1 #\1)) (check-equal? (parse #'(char-range "1" "3") null) '(char-range #\1 #\3)) (check-equal? (parse #'(char-complement (union "1" "2")) null) - '(char-complement (union "1" "2")))) + '(char-complement (union "1" "2"))) + (check-equal? (parse #'(char-complement (repetition 1 1 "1")) null) + '(char-complement (repetition 1 1 "1"))) + (check-exn #rx"not a character set" + (λ () (parse #'(char-complement (repetition 6 6 "1")) null))))