The main difficulty in supporting `assert` to behave like `unittest.require` is 
how to avoid cyclic dependencies. assert is used in low-level modules, but 
implementing it to dump variables on failure would require either importing 
std/macros (causing cyclic deps) or using a few select magics from std/macros 
to implement this.

A 2nd tricky part is avoiding multiple evaluation in some edge cases, eg: 
`assert lhs() == rhs()` => to avoid multiple evaluation you need: let a = 
lhs(); let b = rhs(); ... but that can cause un-necessary copies depending on 
typeof(a); and using `let a = lhs().unsafeAddr` doesn't always work. But 
unittest.require faces the same problem.

Definitely doable and worth doing though.

Reply via email to