Skip to content

Commit 945d1cd

Browse files
Fix 1 occurrence of always-throwing-if-to-when
Using `when` and `unless` is simpler than a conditional with an always-throwing branch.
1 parent 672aea3 commit 945d1cd

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

scribble-test/tests/scribble/reader.rkt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -947,14 +947,14 @@ END-OF-TESTS
947947
(define m
948948
(or (regexp-match #px"^(.*)\n\\s*(-\\S+->)\\s*\n(.*)$" t)
949949
(regexp-match #px"^(.*\\S)\\s+(-\\S+->)\\s+(\\S.*)$" t)))
950-
(if (not (and m (= 4 (length m))))
951-
(error 'bad-test "~a" t)
952-
(let-values ([(x y) ((string->tester (caddr m)) (cadr m) (cadddr m))])
953-
(test #:failure-message (format "bad result in\n ~a\n results:\n ~s != ~s"
954-
(regexp-replace* #rx"\n" t "\n ")
955-
x
956-
y)
957-
(matching? x y)))))))
950+
(unless (and m (= 4 (length m)))
951+
(error 'bad-test "~a" t))
952+
(let-values ([(x y) ((string->tester (caddr m)) (cadr m) (cadddr m))])
953+
(test #:failure-message (format "bad result in\n ~a\n results:\n ~s != ~s"
954+
(regexp-replace* #rx"\n" t "\n ")
955+
x
956+
y)
957+
(matching? x y))))))
958958

959959
;; Check static versus dynamic readtable for command (dynamic when "c" in the
960960
;; name) and datum (dynamic when "d" in the name) parts:

0 commit comments

Comments
 (0)