flint
flint copied to clipboard
More `is_canonical` functions for tests
A good test should check that the output is canonical. Most modules miss such a function.
BTW, a good way to automate such testing is to put a FLINT_ASSERT(is_canonical(...)) in the clear method.
Yes, but I think it can be nice to be even more specific and check after function calls.
My thinking is that assertions should only be used to check (1) internal states and (2) that the user did not give any weird inputs (say user trying to multiply 7 by 3 in the integers modulo 5). Hence, it is my opinion that it is the test code's responsibility to check that the outputs are correct.