CatalaLang / catala

Programming language for literate programming law specification

Home Page:https://catala-lang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

clerk should collect tests in included files

denismerigoux opened this issue · comments

Consider the following situation :

  • a code.catala_fr file containing the code you want to test
  • several tests1.catala_fr, test2.catala_fr files containing your test cases but that don't include code.catala_fr
  • a bundle.catala_fr that includes code.catala_fr and then all the test files.

This situation is useful because calling catala LateX bundle.catala_fr creates a big PDF with all the code and test cases in it, something you can't do with the scheme where each of of the test<n>.catala_fr includes code.catala_fr of their own.

In that situation, how to have clerk execute all the tests in test<n>.catala_fr ? You have to use clerk test bundle.catala_fr because you can't call Catala independantly on test<n>.catala_fr which don't include code.catala_fr.

However clerk test bundle.catala_fr fails because clerk does not support collecting catala-test-inline declarations across file inclusion. This feature should be added to clerk.

#491 is a naive attempt to implement this that begs for further discussion :)