Commit 3c4478d
test: is-thrown skips the type symbol so body actually runs
`(is (thrown? <Type> body))` used to splice (rest expr) into a
do-block. (rest expr) was (<Type> body), so evaluating <Type>
was the FIRST thing the do-block did. When <Type> was unbound
-- which it always is in mino, since there is no exception
class hierarchy -- the lookup itself threw, the catch arm
caught it, and the assertion passed regardless of what `body`
did. Every test that expected a body throw was therefore
silently green even when the body had been refactored to no
longer throw.
Detect the shape at macroexpansion time:
(thrown? <Type> <body>...) -- JVM-clojure compatible
(thrown? <body>) -- mino's single-arg shorthand
When two or more forms follow `thrown?`, the first is the type
symbol and is dropped before splicing the body; when a single
form follows, it IS the body and is kept. mino's runtime cannot
verify exception class membership, so the type symbol is
documentation-only here; any throw from the body counts as a
pass. Verified by manual reproducer: (is (thrown? Exception
(+ 1 2))) now reports "expected exception but none thrown"
rather than silently passing, and the full 4845-assertion suite
still passes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent bfdc8fb commit 3c4478d
3 files changed
Lines changed: 31 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
3 | 19 | | |
4 | 20 | | |
5 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
62 | 72 | | |
63 | 73 | | |
64 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
0 commit comments