Closed pyrmont closed 3 years ago
@andrewchambers pointed out that Rust has a matches!
macro that has a similar intended use.
(assert (matches (os/date) {:month-day 28}))
my idea kind of relies on matches being added to the main janet to make sense.
@andrewchambers Since is
is a macro in Testament, though, I think I could use the matches
symbol to identify this as a call to (a hypothetical) assert-matches*
function and perhaps do something similar :)
@yumaikas has requested that Testament include a
match
-like assertion. The API would look like:An example usage:
The assertion would pass if
expect-structure
partially matched the actual structure ofactual-value
(rather than an exact match).