Add unit tests for TUnit

This commit is contained in:
Aymeric Fromherz 2022-02-17 18:42:22 +01:00
parent 378ab4697a
commit 56e3720699
6 changed files with 84 additions and 0 deletions

View File

@ -0,0 +1,20 @@
## Article
```catala
declaration enumeration E:
-- Case1 content integer
-- Case2
declaration scope A:
context x content E
context y content integer
scope A:
definition x equals Case1 content 2
definition y under condition match x with pattern
-- Case1 of i : i > 0
-- Case2 : false consequence equals 2
definition y under condition match x with pattern
-- Case1 of i : false
-- Case2 : true consequence equals 2
```

View File

@ -0,0 +1,20 @@
## Article
```catala
declaration enumeration E:
-- Case1 content integer
-- Case2
declaration scope A:
context x content E
context y content integer
scope A:
definition x equals Case1 content 2
definition y under condition match x with pattern
-- Case1 of i : true
-- Case2 : true consequence equals 2
definition y under condition match x with pattern
-- Case1 of i : false
-- Case2 : true consequence equals 2
```

View File

@ -0,0 +1,10 @@
[ERROR] [A.y] This variable might return an empty error:
--> tests/test_proof/bad/enums_unit-empty.catala_en
|
10 | context y content integer
| ^
+ Article
Counterexample generation is disabled so none was generated.
[RESULT] [A.y] No two exceptions to ever overlap for this variable
[RESULT] [A.x] This variable never returns an empty error
[RESULT] [A.x] No two exceptions to ever overlap for this variable

View File

@ -0,0 +1,10 @@
[RESULT] [A.y] This variable never returns an empty error
[ERROR] [A.y] At least two exceptions overlap for this variable:
--> tests/test_proof/bad/enums_unit-overlap.catala_en
|
10 | context y content integer
| ^
+ Article
Counterexample generation is disabled so none was generated.
[RESULT] [A.x] This variable never returns an empty error
[RESULT] [A.x] No two exceptions to ever overlap for this variable

View File

@ -0,0 +1,20 @@
## Article
```catala
declaration enumeration E:
-- Case1 content integer
-- Case2
declaration scope A:
context x content E
context y content integer
scope A:
definition x equals Case1 content 2
definition y under condition match x with pattern
-- Case1 of i : true
-- Case2 : false consequence equals 2
definition y under condition match x with pattern
-- Case1 of i : false
-- Case2 : true consequence equals 2
```

View File

@ -0,0 +1,4 @@
[RESULT] [A.y] This variable never returns an empty error
[RESULT] [A.y] No two exceptions to ever overlap for this variable
[RESULT] [A.x] This variable never returns an empty error
[RESULT] [A.x] No two exceptions to ever overlap for this variable