Skip to content

Commit

Permalink
Handle syntax error in property correctly.
Browse files Browse the repository at this point in the history
The relevant exception handler would return (void) instead of a
boolean, breaking the relevant contract.
  • Loading branch information
mikesperber committed Nov 1, 2024
1 parent b80dc8d commit 33a7a63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion htdp-lib/lang/private/teach.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -3310,7 +3310,8 @@
(with-handlers ((exn:fail?
(lambda (e)
(add-failed-check! (failed-check (property-error srcloc e)
(exn-srcloc e))))))
(exn-srcloc e)))
#f)))
(call-with-values
(lambda ()
(with-handlers
Expand Down
7 changes: 4 additions & 3 deletions htdp-test/tests/test-engine/racket-tests.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@
(= (/ a b) (/ b a))))
(check-failure property-fail?)




; check for malformed property
(check-property
(for-all ((minutes)) #t))
(check-failure property-error?)

0 comments on commit 33a7a63

Please sign in to comment.