diff --git a/Makefile b/Makefile index aa452712..2e4bc71f 100644 --- a/Makefile +++ b/Makefile @@ -315,10 +315,10 @@ CLERK=$(CLERK_BIN) --exe $(CATALA_BIN) \ .FORCE: -test_suite: .FORCE compiler +test_suite: .FORCE install @$(MAKE) -C tests pass_all_tests -test_examples: .FORCE compiler +test_examples: .FORCE install @$(MAKE) -C examples pass_all_tests #> tests : Run interpreter tests diff --git a/tests/test_modules/good/mod_def.catala_en b/tests/test_modules/good/mod_def.catala_en new file mode 100644 index 00000000..9250623d --- /dev/null +++ b/tests/test_modules/good/mod_def.catala_en @@ -0,0 +1,22 @@ +# Test modules + inclusions 1 + +```catala-metadata +declaration enumeration Enum1: + -- Yes + -- No + -- Maybe + +declaration scope S: + output sr content money + output e1 content Enum1 +``` + +```catala +scope S: + definition sr equals $1,000 + definition e1 equals Maybe +``` + +```catala-test-inline +$ catala module --compile --plugin-dir=../../../_build/default/compiler/plugins --disable_warnings +``` diff --git a/tests/test_modules/good/mod_use.catala_en b/tests/test_modules/good/mod_use.catala_en new file mode 100644 index 00000000..976dca20 --- /dev/null +++ b/tests/test_modules/good/mod_use.catala_en @@ -0,0 +1,23 @@ +# Test modules + inclusions 2 + +```catala +declaration scope T2: + t1 scope Mod_def.S +# input i content Enum1 + output o1 content Mod_def.Enum1 + output o2 content Mod_def.Enum1 + output o3 content money + +scope T2: + definition o1 equals Mod_def.Enum1.No + definition o2 equals t1.e1 + definition o3 equals t1.sr +``` + +```catala-test-inline +$ catala interpret -s T2 --disable_warnings --use mod_def.catala_en +[RESULT] Computation successful! Results: +[RESULT] o1 = No () +[RESULT] o2 = Maybe () +[RESULT] o3 = $1,000.00 +```