catala/tests/proof/good/enums-nonbool.catala_en
2024-05-03 15:27:06 +02:00

60 lines
1.3 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/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/proof/good/enums-nonbool.catala_en:5.7-5.8:
│ │
│ 5 │ -- C content boolean
│ │ ‾
└─ Test
┌─[RESULT]─
│ No errors found during the proof mode run.
└─
```