From 4d09d143171c8230972bb5633add0161e5757fd6 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 10 Dec 2018 23:30:37 -0800 Subject: [PATCH] Fix bug in inverting empty character set. --- src/runtime/char-set.scm | 7 +++---- tests/runtime/test-char-set.scm | 8 +------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/runtime/char-set.scm b/src/runtime/char-set.scm index 3b2fbc953..da12fae46 100644 --- a/src/runtime/char-set.scm +++ b/src/runtime/char-set.scm @@ -486,11 +486,10 @@ USA. (rcons start #x110000 inverse) inverse)))) - (if (pair? ilist) - (if (fix:< 0 (car ilist)) + (if (or (not (pair? ilist)) + (fix:< 0 (car ilist))) (loop 0 ilist '()) - (loop (cadr ilist) (cddr ilist) '())) - '())) + (loop (cadr ilist) (cddr ilist) '()))) (define (char-set-union . char-sets) (char-set-union* char-sets)) diff --git a/tests/runtime/test-char-set.scm b/tests/runtime/test-char-set.scm index 91d26d000..a0932d30b 100644 --- a/tests/runtime/test-char-set.scm +++ b/tests/runtime/test-char-set.scm @@ -112,16 +112,10 @@ USA. (lambda () (map (lambda (svl) (with-test-properties - (lambda () - ((lambda (body) - (if (equal? svl '()) - ;; XXX Broken, please fix! - (expect-failure body) - body)) (lambda () (assert-equal (svl-invert-thru svl) - (svl-invert-direct (trim-empty-segments svl)))))) + (svl-invert-direct (trim-empty-segments svl)))) 'EXPRESSION `(SVL-INVERT ,svl))) interesting-svls))) -- 2.25.1