Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More is_canonical functions for tests #1990

Open
albinahlback opened this issue May 20, 2024 · 2 comments
Open

More is_canonical functions for tests #1990

albinahlback opened this issue May 20, 2024 · 2 comments

Comments

@albinahlback
Copy link
Collaborator

A good test should check that the output is canonical. Most modules miss such a function.

@fredrik-johansson
Copy link
Collaborator

BTW, a good way to automate such testing is to put a FLINT_ASSERT(is_canonical(...)) in the clear method.

@albinahlback
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants