Skip to content

Commit

Permalink
Fix assert! on keyword functions
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKnauth authored and fare committed Dec 1, 2021
1 parent 5bd98f7 commit 30d7967
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/std/assert-test.ss
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,12 @@
"Assertion failed \"assert-test.ss\"@\\d+\\.33: \\(member e l\\)\n"
" e => 'needle\n"
" l => \\['stack 'of 'hay\\]\n")
(error-message e)))))

(test-case "test assert! on keyword functions"
(assert! (true 0 a: 1))
(check-exception (assert! (false 0 a: 1))
(lambda (e)
(pregexp-match
"Assertion failed \"assert-test.ss\"@\\d+\\.33: \\(false 0 a: 1\\)\n"
(error-message e)))))))
2 changes: 1 addition & 1 deletion src/std/assert.ss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
(def (split-sub-exprs stx)
(syntax-case stx ()
((f a ...)
(not (special-identifier? #'f))
(and (not (special-identifier? #'f)) (not (stx-ormap stx-keyword? #'(a ...))))
(with-syntax (((x ...) (gentemps #'(a ...))))
[(syntax/loc stx (f x ...)) #'((x a) ...)]))
(_ [stx []])))
Expand Down

0 comments on commit 30d7967

Please sign in to comment.