Open lukaszcz opened 1 month ago
I think we should replace (if possible) the pragmas by Juvix code. Even if the available options in this proposal are minimal, they are bound to grow. So we should take advantage of all the Juvix facilities that we have already implemented, such as default arguments, go to definition, documentation on mouse over, etc.
Better alternative: have builtin data structure(s) that represent tests, e.g., similar to how Tasty does it.
Add a first version of the testing framework discussed at HHH2024.Q3.
Add testing pragmas which specify that a function is a test and how the test should be executed. For now, let's have three possibilities.
test: eval
indicates that the zero-argument boolean property function should be evaluated with the Core evaluator and the result compared withtrue
. Example:test-cases: ident
indicates that the property function should be tested for the argument values specified by Juvix identifierident
. Example:test: rand
specifies that thejuvix-quickcheck
library should be used to generate random test cases Example:The command
juvix test
would collect all tests declared in all modules in the project and run them according to the test pragmas. It would take care under the hood of all details like setting the random seed and usingjuvix-quickcheck
correctly.