Fix bug in inverting empty character set.
authorChris Hanson <org/chris-hanson/cph>
Tue, 11 Dec 2018 07:30:37 +0000 (23:30 -0800)
committerChris Hanson <org/chris-hanson/cph>
Tue, 11 Dec 2018 07:30:37 +0000 (23:30 -0800)
src/runtime/char-set.scm
tests/runtime/test-char-set.scm

index 3b2fbc9538c2f931eb7e2dbe4f973079b62b3054..da12fae467787769f67ca2502cde1a8601f31613 100644 (file)
@@ -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))
index 91d26d000bc0c0b16e289b5c85e6bffd94f77af7..a0932d30bd8b487d55b7532e09853851b87e383a 100644 (file)
@@ -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)))