mirror of
https://github.com/CatalaLang/catala.git
synced 2024-09-20 00:41:05 +03:00
Add unit tests for TUnit
This commit is contained in:
parent
378ab4697a
commit
56e3720699
20
tests/test_proof/bad/enums_unit-empty.catala_en
Normal file
20
tests/test_proof/bad/enums_unit-empty.catala_en
Normal 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
|
||||
```
|
20
tests/test_proof/bad/enums_unit-overlap.catala_en
Normal file
20
tests/test_proof/bad/enums_unit-overlap.catala_en
Normal 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
|
||||
```
|
10
tests/test_proof/bad/output/enums_unit-empty.catala_en.Proof
Normal file
10
tests/test_proof/bad/output/enums_unit-empty.catala_en.Proof
Normal 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
|
@ -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
|
20
tests/test_proof/good/enums_unit.catala_en
Normal file
20
tests/test_proof/good/enums_unit.catala_en
Normal 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
|
||||
```
|
4
tests/test_proof/good/output/enums_unit.catala_en.Proof
Normal file
4
tests/test_proof/good/output/enums_unit.catala_en.Proof
Normal 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
|
Loading…
Reference in New Issue
Block a user