Commit 9b8425a
committed
Improve assert-throws? macro
Since `assert-throws?` throws an exception inside the try regardless of
if the body throws, if the body *doesn't* throw, you get a sort of
strange error message:
```
RuntimeException: Assert failed Expected message: exception! but got
Assert failed Expected a <type pixie.stdlib.RuntimeException>
exception: exception!
```
I fixed this, improved the messages a bit, and also added some extra
arities for just checking that an expression throws, and also just
checking the class of the exception, instead of always the class and the
message.1 parent 4121db2 commit 9b8425a
1 file changed
+19
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
73 | 83 | | |
74 | 84 | | |
75 | 85 | | |
| |||
0 commit comments