mirror of
https://github.com/CatalaLang/catala.git
synced 2024-09-20 00:41:05 +03:00
a9f8fa36b8
they break the tests too often for no good reason
48 lines
1.2 KiB
Plaintext
48 lines
1.2 KiB
Plaintext
## Test
|
|
|
|
```catala
|
|
declaration enumeration T:
|
|
-- C content boolean
|
|
-- D content integer
|
|
|
|
declaration enumeration S:
|
|
-- A content integer
|
|
-- B content T
|
|
|
|
declaration scope A:
|
|
output x content integer
|
|
internal y content S
|
|
|
|
scope A:
|
|
definition y equals B content (D content 1)
|
|
definition x under condition (match y with pattern -- A of a: 1 -- B of b: 2) < 2 consequence equals 0
|
|
definition x under condition match y with pattern -- A of a: false -- B of b: true consequence equals 1
|
|
```
|
|
|
|
|
|
|
|
```catala-test-inline
|
|
$ catala Typecheck --check-invariants
|
|
[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary?
|
|
|
|
┌─⯈ tests/test_proof/good/enums-nonbool.catala_en:5.7-5.8:
|
|
└─┐
|
|
5 │ -- C content boolean
|
|
│ ‾
|
|
└─ Test
|
|
[RESULT] All invariant checks passed
|
|
[RESULT] Typechecking successful!
|
|
```
|
|
|
|
```catala-test-inline
|
|
$ catala Proof --disable-counterexamples
|
|
[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary?
|
|
|
|
┌─⯈ tests/test_proof/good/enums-nonbool.catala_en:5.7-5.8:
|
|
└─┐
|
|
5 │ -- C content boolean
|
|
│ ‾
|
|
└─ Test
|
|
[RESULT] No errors found during the proof mode run.
|
|
```
|