From: Chris Hanson Date: Tue, 11 Dec 2018 07:30:37 +0000 (-0800) Subject: Fix bug in inverting empty character set. X-Git-Tag: mit-scheme-pucked-10.1.7~3^2~4 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=4d09d143171c8230972bb5633add0161e5757fd6;p=mit-scheme.git Fix bug in inverting empty character set. --- 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)))