mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-08 07:51:43 +03:00
refactor(tests)!: migrate test file from the abbreviated syntax to the english one
This commit is contained in:
parent
75570864d2
commit
0ffbb9b266
@ -12,12 +12,13 @@
|
||||
or implied. See the License for the specific language governing permissions and limitations under
|
||||
the License. *)
|
||||
|
||||
(* TODO: Factorize frontend_lang and backend_lang into a unique algebric type. *)
|
||||
type frontend_lang = [ `Fr | `En | `Pl ]
|
||||
|
||||
type backend_lang = [ `Fr | `En | `Pl ]
|
||||
|
||||
let to_backend_lang (lang : frontend_lang) : backend_lang =
|
||||
match lang with `En | `Fr -> `Fr | `Pl -> `Pl
|
||||
match lang with `En -> `En | `Fr -> `Fr | `Pl -> `Pl
|
||||
|
||||
(** Source files to be compiled *)
|
||||
let source_files : string list ref = ref []
|
||||
|
@ -1,11 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new scope A:
|
||||
param list content set int
|
||||
param list_high_count content int
|
||||
|
||||
scope A:
|
||||
def list := [0; 5; 6; 7; 1; 64; 12]
|
||||
def list_high_count := number for m in list of (m >=$ $7)
|
||||
```
|
11
tests/test_array/bad/fold_error.catala_en
Normal file
11
tests/test_array/bad/fold_error.catala_en
Normal file
@ -0,0 +1,11 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
declaration scope A:
|
||||
context list content collection integer
|
||||
context list_high_count content integer
|
||||
|
||||
scope A:
|
||||
definition list equals [0; 5; 6; 7; 1; 64; 12]
|
||||
definition list_high_count equals number for m in list of (m >=$ $7)
|
||||
```
|
@ -1,24 +0,0 @@
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
[ERROR] --> money
|
||||
[ERROR] --> integer
|
||||
[ERROR]
|
||||
[ERROR] Error coming from typechecking the following expression:
|
||||
[ERROR] --> test_array/bad/fold_error.catala
|
||||
[ERROR] |
|
||||
[ERROR] 10 | def list_high_count := number for m in list of (m >=$ $7)
|
||||
[ERROR] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
[ERROR] + Article
|
||||
[ERROR]
|
||||
[ERROR] Type money coming from expression:
|
||||
[ERROR] --> test_array/bad/fold_error.catala
|
||||
[ERROR] |
|
||||
[ERROR] 10 | def list_high_count := number for m in list of (m >=$ $7)
|
||||
[ERROR] | ^^^
|
||||
[ERROR] + Article
|
||||
[ERROR]
|
||||
[ERROR] Type integer coming from expression:
|
||||
[ERROR] --> test_array/bad/fold_error.catala
|
||||
[ERROR] |
|
||||
[ERROR] 5 | param list content set int
|
||||
[ERROR] | ^^^^^^^
|
||||
[ERROR] + Article
|
24
tests/test_array/bad/output/fold_error.catala_en.A.out
Normal file
24
tests/test_array/bad/output/fold_error.catala_en.A.out
Normal file
@ -0,0 +1,24 @@
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
[ERROR] --> money
|
||||
[ERROR] --> integer
|
||||
[ERROR]
|
||||
[ERROR] Error coming from typechecking the following expression:
|
||||
[ERROR] --> test_array/bad/fold_error.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 10 | definition list_high_count equals number for m in list of (m >=$ $7)
|
||||
[ERROR] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
[ERROR] + Article
|
||||
[ERROR]
|
||||
[ERROR] Type money coming from expression:
|
||||
[ERROR] --> test_array/bad/fold_error.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 10 | definition list_high_count equals number for m in list of (m >=$ $7)
|
||||
[ERROR] | ^^^
|
||||
[ERROR] + Article
|
||||
[ERROR]
|
||||
[ERROR] Type integer coming from expression:
|
||||
[ERROR] --> test_array/bad/fold_error.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 5 | context list content collection integer
|
||||
[ERROR] | ^^^^^^^^^^^^^^^^^^
|
||||
[ERROR] + Article
|
@ -1,22 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new scope A:
|
||||
param x content set money
|
||||
|
||||
scope A:
|
||||
def x := [$0; $4 +$ $5; $8 *$ 0.65]
|
||||
|
||||
new scope B:
|
||||
param a scope A
|
||||
param max content money
|
||||
param min content money
|
||||
param y content money
|
||||
param z content int
|
||||
|
||||
scope B:
|
||||
def max := maximum money init $0 for m in a.x of m *$ 2.0
|
||||
def min := minimum money init $20 for m in a.x of m +$ $5
|
||||
def y := sum money for m in a.x of (m +$ $1)
|
||||
def z := number for m in a.x of (m >=$ $8.95)
|
||||
```
|
22
tests/test_array/good/aggregation.catala_en
Normal file
22
tests/test_array/good/aggregation.catala_en
Normal file
@ -0,0 +1,22 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
declaration scope A:
|
||||
context x content collection money
|
||||
|
||||
scope A:
|
||||
definition x equals [$0; $4 +$ $5; $8 *$ 0.65]
|
||||
|
||||
declaration scope B:
|
||||
context a scope A
|
||||
context max content money
|
||||
context min content money
|
||||
context y content money
|
||||
context z content integer
|
||||
|
||||
scope B:
|
||||
definition max equals maximum money initial $0 for m in a.x of m *$ 2.0
|
||||
definition min equals minimum money initial $20 for m in a.x of m +$ $5
|
||||
definition y equals sum money for m in a.x of (m +$ $1)
|
||||
definition z equals number for m in a.x of (m >=$ $8.95)
|
||||
```
|
@ -1,26 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new struct S:
|
||||
data id content int
|
||||
data income content money
|
||||
|
||||
new scope A:
|
||||
param x content set S
|
||||
|
||||
scope A:
|
||||
def x := [
|
||||
S { -- id: 0 -- income: $0 };
|
||||
S { -- id: 1 -- income: $4 +$ $5 };
|
||||
S { -- id: 2 -- income: $8 *$ 0.65 }
|
||||
]
|
||||
|
||||
new scope B:
|
||||
param a scope A
|
||||
param argmax content S
|
||||
param argmin content S
|
||||
|
||||
scope B:
|
||||
def argmax := content maximum money init S { -- id: -1 --income: $0 } for m in a.x of (m.income *$ 2.0)
|
||||
def argmin := content minimum money init S { -- id: -1 --income: $20 } for m in a.x of (m.income +$ $5)
|
||||
```
|
26
tests/test_array/good/aggregation_2.catala_en
Normal file
26
tests/test_array/good/aggregation_2.catala_en
Normal file
@ -0,0 +1,26 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
declaration structure S:
|
||||
data id content integer
|
||||
data income content money
|
||||
|
||||
declaration scope A:
|
||||
context x content collection S
|
||||
|
||||
scope A:
|
||||
definition x equals [
|
||||
S { -- id: 0 -- income: $0 };
|
||||
S { -- id: 1 -- income: $4 +$ $5 };
|
||||
S { -- id: 2 -- income: $8 *$ 0.65 }
|
||||
]
|
||||
|
||||
declaration scope B:
|
||||
context a scope A
|
||||
context argmax content S
|
||||
context argmin content S
|
||||
|
||||
scope B:
|
||||
definition argmax equals content maximum money initial S { -- id: -1 --income: $0 } for m in a.x of (m.income *$ 2.0)
|
||||
definition argmin equals content minimum money initial S { -- id: -1 --income: $20 } for m in a.x of (m.income +$ $5)
|
||||
```
|
@ -1,18 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new scope A:
|
||||
param x content set money
|
||||
|
||||
scope A:
|
||||
def x := [$0; $4 +$ $5; $8 *$ 0.65]
|
||||
|
||||
new scope B:
|
||||
param a scope A
|
||||
param y content set money
|
||||
param z content set bool
|
||||
|
||||
scope B:
|
||||
def y := filter for m in a.x of (m >=$ $4.95)
|
||||
def z := map for m in a.x of (m >=$ $4.95)
|
||||
```
|
18
tests/test_array/good/filter_map.catala_en
Normal file
18
tests/test_array/good/filter_map.catala_en
Normal file
@ -0,0 +1,18 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
declaration scope A:
|
||||
context x content collection money
|
||||
|
||||
scope A:
|
||||
definition x equals [$0; $4 +$ $5; $8 *$ 0.65]
|
||||
|
||||
declaration scope B:
|
||||
context a scope A
|
||||
context y content collection money
|
||||
context z content collection boolean
|
||||
|
||||
scope B:
|
||||
definition y equals filter for m in a.x of (m >=$ $4.95)
|
||||
definition z equals map for m in a.x of (m >=$ $4.95)
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new scope A:
|
||||
param x content set int
|
||||
|
||||
scope A:
|
||||
def x := [0; 4+5; 8*8]
|
||||
|
||||
new scope B:
|
||||
param a scope A
|
||||
param v content int
|
||||
param w content bool
|
||||
param y content bool
|
||||
param z content bool
|
||||
|
||||
scope B:
|
||||
def v := number of a.x
|
||||
def w := 64 in a.x
|
||||
def y := exists m in a.x such that m = 9
|
||||
def z := for all m in a.x we have m > 0
|
||||
```
|
22
tests/test_array/good/simple.catala_en
Normal file
22
tests/test_array/good/simple.catala_en
Normal file
@ -0,0 +1,22 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
declaration scope A:
|
||||
context x content collection integer
|
||||
|
||||
scope A:
|
||||
definition x equals [0; 4+5; 8*8]
|
||||
|
||||
declaration scope B:
|
||||
context a scope A
|
||||
context v content integer
|
||||
context w content boolean
|
||||
context y content boolean
|
||||
context z content boolean
|
||||
|
||||
scope B:
|
||||
definition v equals number of a.x
|
||||
definition w equals 64 in a.x
|
||||
definition y equals exists m in a.x such that m = 9
|
||||
definition z equals for all m in a.x we have m > 0
|
||||
```
|
@ -1,24 +0,0 @@
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
[ERROR] --> bool
|
||||
[ERROR] --> integer
|
||||
[ERROR]
|
||||
[ERROR] Error coming from typechecking the following expression:
|
||||
[ERROR] --> test_bool/bad/test_xor_with_int.catala
|
||||
[ERROR] |
|
||||
[ERROR] 8 | def test_var := 10 xor 20
|
||||
[ERROR] | ^^^^^^^^^
|
||||
[ERROR] + 'xor' should be a boolean operator
|
||||
[ERROR]
|
||||
[ERROR] Type bool coming from expression:
|
||||
[ERROR] --> test_bool/bad/test_xor_with_int.catala
|
||||
[ERROR] |
|
||||
[ERROR] 8 | def test_var := 10 xor 20
|
||||
[ERROR] | ^^^
|
||||
[ERROR] + 'xor' should be a boolean operator
|
||||
[ERROR]
|
||||
[ERROR] Type integer coming from expression:
|
||||
[ERROR] --> test_bool/bad/test_xor_with_int.catala
|
||||
[ERROR] |
|
||||
[ERROR] 8 | def test_var := 10 xor 20
|
||||
[ERROR] | ^^
|
||||
[ERROR] + 'xor' should be a boolean operator
|
@ -0,0 +1,24 @@
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
[ERROR] --> bool
|
||||
[ERROR] --> integer
|
||||
[ERROR]
|
||||
[ERROR] Error coming from typechecking the following expression:
|
||||
[ERROR] --> test_bool/bad/test_xor_with_int.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 8 | definition test_var equals 10 xor 20
|
||||
[ERROR] | ^^^^^^^^^
|
||||
[ERROR] + 'xor' should be a boolean operator
|
||||
[ERROR]
|
||||
[ERROR] Type bool coming from expression:
|
||||
[ERROR] --> test_bool/bad/test_xor_with_int.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 8 | definition test_var equals 10 xor 20
|
||||
[ERROR] | ^^^
|
||||
[ERROR] + 'xor' should be a boolean operator
|
||||
[ERROR]
|
||||
[ERROR] Type integer coming from expression:
|
||||
[ERROR] --> test_bool/bad/test_xor_with_int.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 8 | definition test_var equals 10 xor 20
|
||||
[ERROR] | ^^
|
||||
[ERROR] + 'xor' should be a boolean operator
|
@ -1,9 +0,0 @@
|
||||
## 'xor' should be a boolean operator
|
||||
|
||||
```catala
|
||||
new scope TestXorWithInt :
|
||||
param test_var content int
|
||||
|
||||
scope TestXorWithInt :
|
||||
def test_var := 10 xor 20
|
||||
```
|
9
tests/test_bool/bad/test_xor_with_int.catala_en
Normal file
9
tests/test_bool/bad/test_xor_with_int.catala_en
Normal file
@ -0,0 +1,9 @@
|
||||
## 'xor' should be a boolean operator
|
||||
|
||||
```catala
|
||||
declaration scope TestXorWithInt:
|
||||
context test_var content integer
|
||||
|
||||
scope TestXorWithInt:
|
||||
definition test_var equals 10 xor 20
|
||||
```
|
@ -1,12 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new scope TestBool :
|
||||
param foo content bool
|
||||
param bar content int
|
||||
|
||||
scope TestBool :
|
||||
def bar := 1
|
||||
def foo [| bar >= 0 |] := true
|
||||
def foo [| bar < 0 |] := false
|
||||
```
|
12
tests/test_bool/good/test_bool.catala_en
Normal file
12
tests/test_bool/good/test_bool.catala_en
Normal file
@ -0,0 +1,12 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
declaration scope TestBool:
|
||||
context foo content boolean
|
||||
context bar content integer
|
||||
|
||||
scope TestBool:
|
||||
definition bar equals 1
|
||||
definition foo under condition bar >= 0 consequence equals true
|
||||
definition foo under condition bar < 0 consequence equals false
|
||||
```
|
@ -1,15 +0,0 @@
|
||||
## Test all 'xor' combinations
|
||||
|
||||
```catala
|
||||
new scope TestXor :
|
||||
param t_xor_t content bool
|
||||
param t_xor_f content bool
|
||||
param f_xor_t content bool
|
||||
param f_xor_f content bool
|
||||
|
||||
scope TestXor :
|
||||
def t_xor_t := true xor true
|
||||
def f_xor_t := false xor true
|
||||
def t_xor_f := true xor false
|
||||
def f_xor_f := false xor false
|
||||
```
|
15
tests/test_bool/good/test_xor.catala_en
Normal file
15
tests/test_bool/good/test_xor.catala_en
Normal file
@ -0,0 +1,15 @@
|
||||
## Test all 'xor' combinations
|
||||
|
||||
```catala
|
||||
declaration scope TestXor:
|
||||
context t_xor_t content boolean
|
||||
context t_xor_f content boolean
|
||||
context f_xor_t content boolean
|
||||
context f_xor_f content boolean
|
||||
|
||||
scope TestXor:
|
||||
definition t_xor_t equals true xor true
|
||||
definition f_xor_t equals false xor true
|
||||
definition t_xor_f equals true xor false
|
||||
definition f_xor_f equals false xor false
|
||||
```
|
@ -1,17 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new scope A:
|
||||
param x content date
|
||||
param y content date
|
||||
param z content bool
|
||||
param z2 content bool
|
||||
param z3 content duration
|
||||
|
||||
scope A:
|
||||
def x := |2019-01-01|
|
||||
def y := |2002-09-30|
|
||||
def z := y +@ (x -@ y) = x
|
||||
def z3 := x -@ y
|
||||
def z2 := z3 = 5937 day
|
||||
```
|
17
tests/test_date/good/durations.catala_en
Normal file
17
tests/test_date/good/durations.catala_en
Normal file
@ -0,0 +1,17 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
declaration scope A:
|
||||
context x content date
|
||||
context y content date
|
||||
context z content boolean
|
||||
context z2 content boolean
|
||||
context z3 content duration
|
||||
|
||||
scope A:
|
||||
definition x equals |2019-01-01|
|
||||
definition y equals |2002-09-30|
|
||||
definition z equals y +@ (x -@ y) = x
|
||||
definition z3 equals x -@ y
|
||||
definition z2 equals z3 = 5937 day
|
||||
```
|
@ -1,13 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new scope A:
|
||||
param x content date
|
||||
param y content date
|
||||
param z content duration
|
||||
|
||||
scope A:
|
||||
def x := |2019-01-01|
|
||||
def y := |2002-09-30|
|
||||
def z := x -@ y
|
||||
```
|
13
tests/test_date/good/simple.catala_en
Normal file
13
tests/test_date/good/simple.catala_en
Normal file
@ -0,0 +1,13 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
declaration scope A:
|
||||
context x content date
|
||||
context y content date
|
||||
context z content duration
|
||||
|
||||
scope A:
|
||||
definition x equals |2019-01-01|
|
||||
definition y equals |2002-09-30|
|
||||
definition z equals x -@ y
|
||||
```
|
@ -1,15 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new scope A:
|
||||
param x content dec
|
||||
param y content dec
|
||||
param z content dec
|
||||
param a content dec
|
||||
|
||||
scope A:
|
||||
def x := 84.64866565265689623
|
||||
def y := -. 4.36829778705320654980
|
||||
def z := 654265429805103220650980650.5705405106540
|
||||
def a := x /. y *. (x +. y) *. (x *. x *. z *. z)
|
||||
```
|
15
tests/test_dec/good/infinite_precision.catala_en
Normal file
15
tests/test_dec/good/infinite_precision.catala_en
Normal file
@ -0,0 +1,15 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
declaration scope A:
|
||||
context x content decimal
|
||||
context y content decimal
|
||||
context z content decimal
|
||||
context a content decimal
|
||||
|
||||
scope A:
|
||||
definition x equals 84.64866565265689623
|
||||
definition y equals -. 4.36829778705320654980
|
||||
definition z equals 654265429805103220650980650.5705405106540
|
||||
definition a equals x /. y *. (x +. y) *. (x *. x *. z *. z)
|
||||
```
|
@ -1,13 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new scope A:
|
||||
param x content dec
|
||||
param y content dec
|
||||
param z content dec
|
||||
|
||||
scope A:
|
||||
def x := 84.648665
|
||||
def y := 4.368297
|
||||
def z := x /. y
|
||||
```
|
13
tests/test_dec/good/simple.catala_en
Normal file
13
tests/test_dec/good/simple.catala_en
Normal file
@ -0,0 +1,13 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
declaration scope A:
|
||||
context x content decimal
|
||||
context y content decimal
|
||||
context z content decimal
|
||||
|
||||
scope A:
|
||||
definition x equals 84.648665
|
||||
definition y equals 4.368297
|
||||
definition z equals x /. y
|
||||
```
|
@ -1,10 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new scope A:
|
||||
param x content int
|
||||
|
||||
scope A:
|
||||
def x [|true|] := 1
|
||||
def x [|true|] := 0
|
||||
```
|
10
tests/test_default/bad/conflict.catala_en
Normal file
10
tests/test_default/bad/conflict.catala_en
Normal file
@ -0,0 +1,10 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
declaration scope A:
|
||||
context x content integer
|
||||
|
||||
scope A:
|
||||
definition x under condition true consequence equals 1
|
||||
definition x under condition true consequence equals 0
|
||||
```
|
@ -1,10 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new scope A:
|
||||
param x content int
|
||||
param y content bool
|
||||
|
||||
scope A:
|
||||
def x := 1
|
||||
```
|
10
tests/test_default/bad/empty.catala_en
Normal file
10
tests/test_default/bad/empty.catala_en
Normal file
@ -0,0 +1,10 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
declaration scope A:
|
||||
context x content integer
|
||||
context y content boolean
|
||||
|
||||
scope A:
|
||||
definition x equals 1
|
||||
```
|
@ -1,13 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new scope A:
|
||||
param x content int
|
||||
param y content int
|
||||
|
||||
scope A:
|
||||
def y := 1
|
||||
def x [|y = 2|] := 1
|
||||
def x [|y = 3|] := 1
|
||||
def x [|y = 4|] := 1
|
||||
```
|
13
tests/test_default/bad/empty_with_rules.catala_en
Normal file
13
tests/test_default/bad/empty_with_rules.catala_en
Normal file
@ -0,0 +1,13 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
declaration scope A:
|
||||
context x content integer
|
||||
context y content integer
|
||||
|
||||
scope A:
|
||||
definition y equals 1
|
||||
definition x under condition y = 2 consequence equals 1
|
||||
definition x under condition y = 3 consequence equals 1
|
||||
definition x under condition y = 4 consequence equals 1
|
||||
```
|
@ -1,15 +0,0 @@
|
||||
[ERROR] There is a conflict between multiple exceptions for assigning the same variable.
|
||||
[ERROR]
|
||||
[ERROR] This justification is true:
|
||||
[ERROR] --> test_default/bad/conflict.catala
|
||||
[ERROR] |
|
||||
[ERROR] 9 | def x [|true|] := 0
|
||||
[ERROR] | ^^^^
|
||||
[ERROR] + Article
|
||||
[ERROR]
|
||||
[ERROR] This justification is true:
|
||||
[ERROR] --> test_default/bad/conflict.catala
|
||||
[ERROR] |
|
||||
[ERROR] 8 | def x [|true|] := 1
|
||||
[ERROR] | ^^^^
|
||||
[ERROR] + Article
|
15
tests/test_default/bad/output/conflict.catala_en.A.out
Normal file
15
tests/test_default/bad/output/conflict.catala_en.A.out
Normal file
@ -0,0 +1,15 @@
|
||||
[ERROR] There is a conflict between multiple exceptions for assigning the same variable.
|
||||
[ERROR]
|
||||
[ERROR] This justification is true:
|
||||
[ERROR] --> test_default/bad/conflict.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 9 | definition x under condition true consequence equals 0
|
||||
[ERROR] | ^^^^
|
||||
[ERROR] + Article
|
||||
[ERROR]
|
||||
[ERROR] This justification is true:
|
||||
[ERROR] --> test_default/bad/conflict.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 8 | definition x under condition true consequence equals 1
|
||||
[ERROR] | ^^^^
|
||||
[ERROR] + Article
|
@ -1,7 +1,7 @@
|
||||
[ERROR] This variable evaluated to an empty term (no rule that defined it applied in this situation)
|
||||
[ERROR]
|
||||
[ERROR] --> test_default/bad/empty.catala
|
||||
[ERROR] --> test_default/bad/empty.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 6 | param y content bool
|
||||
[ERROR] | ^
|
||||
[ERROR] 6 | context y content boolean
|
||||
[ERROR] | ^
|
||||
[ERROR] + Article
|
@ -1,7 +1,7 @@
|
||||
[ERROR] This variable evaluated to an empty term (no rule that defined it applied in this situation)
|
||||
[ERROR]
|
||||
[ERROR] --> test_default/bad/empty_with_rules.catala
|
||||
[ERROR] --> test_default/bad/empty_with_rules.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 5 | param x content int
|
||||
[ERROR] | ^
|
||||
[ERROR] 5 | context x content integer
|
||||
[ERROR] | ^
|
||||
[ERROR] + Article
|
@ -1,15 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new enum E:
|
||||
-- Case1
|
||||
|
||||
new enum F:
|
||||
-- Case1
|
||||
|
||||
new scope A:
|
||||
param e content E
|
||||
|
||||
scope A:
|
||||
def e := Case1
|
||||
```catala
|
15
tests/test_enum/bad/ambiguous_cases.catala_en
Normal file
15
tests/test_enum/bad/ambiguous_cases.catala_en
Normal file
@ -0,0 +1,15 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
declaration enumeration E:
|
||||
-- Case1
|
||||
|
||||
declaration enumeration F:
|
||||
-- Case1
|
||||
|
||||
declaration scope A:
|
||||
context e content E
|
||||
|
||||
scope A:
|
||||
definition e equals Case1
|
||||
```
|
@ -1,19 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new enum E:
|
||||
-- Case1 content int
|
||||
-- Case2 content bool
|
||||
-- Case3
|
||||
|
||||
new scope A:
|
||||
param e content E
|
||||
param out content bool
|
||||
|
||||
scope A:
|
||||
def out := match e with
|
||||
-- Case1 of i : i = 0
|
||||
-- Case2 of b : b
|
||||
-- Case3 : false
|
||||
-- Case3 : true
|
||||
```
|
19
tests/test_enum/bad/duplicate_case.catala_en
Normal file
19
tests/test_enum/bad/duplicate_case.catala_en
Normal file
@ -0,0 +1,19 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
declaration enumeration E:
|
||||
-- Case1 content integer
|
||||
-- Case2 content boolean
|
||||
-- Case3
|
||||
|
||||
declaration scope A:
|
||||
context e content E
|
||||
context out content boolean
|
||||
|
||||
scope A:
|
||||
definition out equals match e with pattern
|
||||
-- Case1 of i : i = 0
|
||||
-- Case2 of b : b
|
||||
-- Case3 : false
|
||||
-- Case3 : true
|
||||
```
|
@ -1,17 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new enum E:
|
||||
-- Case1 content int
|
||||
-- Case2 content bool
|
||||
-- Case3
|
||||
|
||||
new scope A:
|
||||
param e content E
|
||||
param out content bool
|
||||
|
||||
scope A:
|
||||
def out := match e with
|
||||
-- Case1 of i : i = 0
|
||||
-- Case2 of b : b
|
||||
```
|
17
tests/test_enum/bad/missing_case.catala_en
Normal file
17
tests/test_enum/bad/missing_case.catala_en
Normal file
@ -0,0 +1,17 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
declaration enumeration E:
|
||||
-- Case1 content integer
|
||||
-- Case2 content boolean
|
||||
-- Case3
|
||||
|
||||
declaration scope A:
|
||||
context e content E
|
||||
context out content boolean
|
||||
|
||||
scope A:
|
||||
definition out equals match e with pattern
|
||||
-- Case1 of i : i = 0
|
||||
-- Case2 of b : b
|
||||
```
|
@ -1,7 +1,7 @@
|
||||
[ERROR] This constructor name is ambiguous, it can belong to E or F. Desambiguate it by prefixing it with the enum name.
|
||||
[ERROR]
|
||||
[ERROR] --> test_enum/bad/ambiguous_cases.catala
|
||||
[ERROR] --> test_enum/bad/ambiguous_cases.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 14 | def e := Case1
|
||||
[ERROR] | ^^^^^
|
||||
[ERROR] 14 | definition e equals Case1
|
||||
[ERROR] | ^^^^^
|
||||
[ERROR] + Article
|
@ -1,12 +1,12 @@
|
||||
[ERROR] The constructor Case3 has been matched twice:
|
||||
[ERROR]
|
||||
[ERROR] --> test_enum/bad/duplicate_case.catala
|
||||
[ERROR] --> test_enum/bad/duplicate_case.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 18 | -- Case3 : true
|
||||
[ERROR] | ^^^^
|
||||
[ERROR] + Article
|
||||
[ERROR]
|
||||
[ERROR] --> test_enum/bad/duplicate_case.catala
|
||||
[ERROR] --> test_enum/bad/duplicate_case.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 17 | -- Case3 : false
|
||||
[ERROR] | ^^^^^
|
@ -1,9 +1,9 @@
|
||||
[ERROR] The constructor Case3 of enum E is missing from this pattern matching
|
||||
[ERROR]
|
||||
[ERROR] --> test_enum/bad/missing_case.catala
|
||||
[ERROR] --> test_enum/bad/missing_case.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 14 | def out := match e with
|
||||
[ERROR] | ^^^^^^^^^^^
|
||||
[ERROR] 14 | definition out equals match e with pattern
|
||||
[ERROR] | ^^^^^^^^^^^^^^^^^^^
|
||||
[ERROR] 15 | -- Case1 of i : i = 0
|
||||
[ERROR] | ^^^^^^^^^^^^^^^^^^^^^
|
||||
[ERROR] 16 | -- Case2 of b : b
|
24
tests/test_enum/bad/output/quick_pattern_2.catala_en.A.out
Normal file
24
tests/test_enum/bad/output/quick_pattern_2.catala_en.A.out
Normal file
@ -0,0 +1,24 @@
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
[ERROR] --> F
|
||||
[ERROR] --> E
|
||||
[ERROR]
|
||||
[ERROR] Error coming from typechecking the following expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_2.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 28 | definition y equals x with pattern Case3
|
||||
[ERROR] | ^
|
||||
[ERROR] + Article
|
||||
[ERROR]
|
||||
[ERROR] Type F coming from expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_2.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 28 | definition y equals x with pattern Case3
|
||||
[ERROR] | ^
|
||||
[ERROR] + Article
|
||||
[ERROR]
|
||||
[ERROR] Type E coming from expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_2.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 17 | context x content E
|
||||
[ERROR] | ^
|
||||
[ERROR] + Article
|
3
tests/test_enum/bad/output/quick_pattern_2.catala_en.out
Normal file
3
tests/test_enum/bad/output/quick_pattern_2.catala_en.out
Normal file
@ -0,0 +1,3 @@
|
||||
catala: option `-s' needs an argument
|
||||
Usage: catala [OPTION]... BACKEND FILE
|
||||
Try `catala --help' for more information.
|
@ -1,24 +0,0 @@
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
[ERROR] --> F
|
||||
[ERROR] --> E
|
||||
[ERROR]
|
||||
[ERROR] Error coming from typechecking the following expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_3.catala
|
||||
[ERROR] |
|
||||
[ERROR] 18 | def y := x with Case3
|
||||
[ERROR] | ^
|
||||
[ERROR] + Article
|
||||
[ERROR]
|
||||
[ERROR] Type F coming from expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_3.catala
|
||||
[ERROR] |
|
||||
[ERROR] 18 | def y := x with Case3
|
||||
[ERROR] | ^
|
||||
[ERROR] + Article
|
||||
[ERROR]
|
||||
[ERROR] Type E coming from expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_3.catala
|
||||
[ERROR] |
|
||||
[ERROR] 13 | param x content E
|
||||
[ERROR] | ^
|
||||
[ERROR] + Article
|
@ -3,22 +3,22 @@
|
||||
[ERROR] --> E
|
||||
[ERROR]
|
||||
[ERROR] Error coming from typechecking the following expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_2.catala
|
||||
[ERROR] --> test_enum/bad/quick_pattern_3.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 28 | def y := x with Case3
|
||||
[ERROR] | ^
|
||||
[ERROR] 18 | definition y equals x with pattern Case3
|
||||
[ERROR] | ^
|
||||
[ERROR] + Article
|
||||
[ERROR]
|
||||
[ERROR] Type F coming from expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_2.catala
|
||||
[ERROR] --> test_enum/bad/quick_pattern_3.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 28 | def y := x with Case3
|
||||
[ERROR] | ^
|
||||
[ERROR] 18 | definition y equals x with pattern Case3
|
||||
[ERROR] | ^
|
||||
[ERROR] + Article
|
||||
[ERROR]
|
||||
[ERROR] Type E coming from expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_2.catala
|
||||
[ERROR] --> test_enum/bad/quick_pattern_3.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 17 | param x content E
|
||||
[ERROR] 13 | context x content E
|
||||
[ERROR] | ^
|
||||
[ERROR] + Article
|
@ -1,24 +0,0 @@
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
[ERROR] --> F
|
||||
[ERROR] --> E
|
||||
[ERROR]
|
||||
[ERROR] Error coming from typechecking the following expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_4.catala
|
||||
[ERROR] |
|
||||
[ERROR] 17 | def y := x with Case3
|
||||
[ERROR] | ^
|
||||
[ERROR] + Test
|
||||
[ERROR]
|
||||
[ERROR] Type F coming from expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_4.catala
|
||||
[ERROR] |
|
||||
[ERROR] 17 | def y := x with Case3
|
||||
[ERROR] | ^
|
||||
[ERROR] + Test
|
||||
[ERROR]
|
||||
[ERROR] Type E coming from expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_4.catala
|
||||
[ERROR] |
|
||||
[ERROR] 12 | param x content E
|
||||
[ERROR] | ^
|
||||
[ERROR] + Test
|
24
tests/test_enum/bad/output/quick_pattern_4.catala_en.A.out
Normal file
24
tests/test_enum/bad/output/quick_pattern_4.catala_en.A.out
Normal file
@ -0,0 +1,24 @@
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
[ERROR] --> F
|
||||
[ERROR] --> E
|
||||
[ERROR]
|
||||
[ERROR] Error coming from typechecking the following expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_4.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 17 | definition y equals x with pattern Case3
|
||||
[ERROR] | ^
|
||||
[ERROR] + Test
|
||||
[ERROR]
|
||||
[ERROR] Type F coming from expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_4.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 17 | definition y equals x with pattern Case3
|
||||
[ERROR] | ^
|
||||
[ERROR] + Test
|
||||
[ERROR]
|
||||
[ERROR] Type E coming from expression:
|
||||
[ERROR] --> test_enum/bad/quick_pattern_4.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 12 | context x content E
|
||||
[ERROR] | ^
|
||||
[ERROR] + Test
|
@ -1,7 +0,0 @@
|
||||
[ERROR] The name of this constructor has not been defined before, maybe it is a typo?
|
||||
[ERROR]
|
||||
[ERROR] --> test_enum/bad/quick_pattern_fail.catala
|
||||
[ERROR] |
|
||||
[ERROR] 15 | def y := x with Case3
|
||||
[ERROR] | ^^^^^
|
||||
[ERROR] + Article
|
@ -0,0 +1,7 @@
|
||||
[ERROR] The name of this constructor has not been defined before, maybe it is a typo?
|
||||
[ERROR]
|
||||
[ERROR] --> test_enum/bad/quick_pattern_fail.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 15 | definition y equals x with pattern Case3
|
||||
[ERROR] | ^^^^^
|
||||
[ERROR] + Article
|
@ -1,6 +1,6 @@
|
||||
[ERROR] This case matches a constructor of enumeration E but previous case were matching constructors of enumeration F
|
||||
[ERROR]
|
||||
[ERROR] --> test_enum/bad/too_many_cases.catala
|
||||
[ERROR] --> test_enum/bad/too_many_cases.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 21 | -- Case4 : true
|
||||
[ERROR] | ^^^^^^^^^^^^
|
@ -1,29 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new enum E:
|
||||
-- Case1 content int
|
||||
-- Case2
|
||||
|
||||
new enum F:
|
||||
-- Case3
|
||||
|
||||
new scope A:
|
||||
param x content E
|
||||
param y content bool
|
||||
param z content bool
|
||||
|
||||
new scope B:
|
||||
param x content E
|
||||
param y content bool
|
||||
param z content bool
|
||||
|
||||
scope A:
|
||||
def x := Case1 content 2
|
||||
def y := x with Case1
|
||||
def z := x with Case2
|
||||
|
||||
scope B:
|
||||
def x := Case2
|
||||
def y := x with Case3
|
||||
```
|
29
tests/test_enum/bad/quick_pattern_2.catala_en
Normal file
29
tests/test_enum/bad/quick_pattern_2.catala_en
Normal file
@ -0,0 +1,29 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
declaration enumeration E:
|
||||
-- Case1 content integer
|
||||
-- Case2
|
||||
|
||||
declaration enumeration F:
|
||||
-- Case3
|
||||
|
||||
declaration scope A:
|
||||
context x content E
|
||||
context y content boolean
|
||||
context z content boolean
|
||||
|
||||
declaration scope B:
|
||||
context x content E
|
||||
context y content boolean
|
||||
context z content boolean
|
||||
|
||||
scope A:
|
||||
definition x equals Case1 content 2
|
||||
definition y equals x with pattern Case1
|
||||
definition z equals x with pattern Case2
|
||||
|
||||
scope B:
|
||||
definition x equals Case2
|
||||
definition y equals x with pattern Case3
|
||||
```
|
@ -1,19 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new enum E:
|
||||
-- Case1
|
||||
-- Case2
|
||||
|
||||
new enum F:
|
||||
-- Case3
|
||||
-- Case4
|
||||
|
||||
new scope A:
|
||||
param x content E
|
||||
param y content bool
|
||||
|
||||
scope A:
|
||||
def x := Case1
|
||||
def y := x with Case3
|
||||
```
|
19
tests/test_enum/bad/quick_pattern_3.catala_en
Normal file
19
tests/test_enum/bad/quick_pattern_3.catala_en
Normal file
@ -0,0 +1,19 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
declaration enumeration E:
|
||||
-- Case1
|
||||
-- Case2
|
||||
|
||||
declaration enumeration F:
|
||||
-- Case3
|
||||
-- Case4
|
||||
|
||||
declaration scope A:
|
||||
context x content E
|
||||
context y content boolean
|
||||
|
||||
scope A:
|
||||
definition x equals Case1
|
||||
definition y equals x with pattern Case3
|
||||
```
|
@ -1,18 +0,0 @@
|
||||
## Test
|
||||
|
||||
```catala
|
||||
new enum E:
|
||||
-- Case1
|
||||
-- Case2
|
||||
|
||||
new enum F:
|
||||
-- Case3
|
||||
|
||||
new scope A:
|
||||
param x content E
|
||||
param y content bool
|
||||
|
||||
scope A:
|
||||
def x := Case1
|
||||
def y := x with Case3
|
||||
```
|
18
tests/test_enum/bad/quick_pattern_4.catala_en
Normal file
18
tests/test_enum/bad/quick_pattern_4.catala_en
Normal file
@ -0,0 +1,18 @@
|
||||
## Test
|
||||
|
||||
```catala
|
||||
declaration enumeration E:
|
||||
-- Case1
|
||||
-- Case2
|
||||
|
||||
declaration enumeration F:
|
||||
-- Case3
|
||||
|
||||
declaration scope A:
|
||||
context x content E
|
||||
context y content boolean
|
||||
|
||||
scope A:
|
||||
definition x equals Case1
|
||||
definition y equals x with pattern Case3
|
||||
```
|
@ -1,16 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new enum E:
|
||||
-- Case1 content int
|
||||
-- Case2
|
||||
|
||||
new scope A:
|
||||
param x content E
|
||||
param y content bool
|
||||
param z content bool
|
||||
|
||||
scope A:
|
||||
def x := Case1 content 2
|
||||
def y := x with Case3
|
||||
```
|
16
tests/test_enum/bad/quick_pattern_fail.catala_en
Normal file
16
tests/test_enum/bad/quick_pattern_fail.catala_en
Normal file
@ -0,0 +1,16 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
declaration enumeration E:
|
||||
-- Case1 content integer
|
||||
-- Case2
|
||||
|
||||
declaration scope A:
|
||||
context x content E
|
||||
context y content boolean
|
||||
context z content boolean
|
||||
|
||||
scope A:
|
||||
definition x equals Case1 content 2
|
||||
definition y equals x with pattern Case3
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new enum E:
|
||||
-- Case1 content int
|
||||
-- Case2 content bool
|
||||
-- Case3
|
||||
|
||||
new enum F:
|
||||
-- Case4
|
||||
|
||||
new scope A:
|
||||
param e content E
|
||||
param out content bool
|
||||
|
||||
scope A:
|
||||
def out := match e with
|
||||
-- Case1 of i : i = 0
|
||||
-- Case2 of b : b
|
||||
-- Case3 : false
|
||||
-- Case4 : true
|
||||
```
|
22
tests/test_enum/bad/too_many_cases.catala_en
Normal file
22
tests/test_enum/bad/too_many_cases.catala_en
Normal file
@ -0,0 +1,22 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
declaration enumeration E:
|
||||
-- Case1 content integer
|
||||
-- Case2 content boolean
|
||||
-- Case3
|
||||
|
||||
declaration enumeration F:
|
||||
-- Case4
|
||||
|
||||
declaration scope A:
|
||||
context e content E
|
||||
context out content boolean
|
||||
|
||||
scope A:
|
||||
definition out equals match e with pattern
|
||||
-- Case1 of i : i = 0
|
||||
-- Case2 of b : b
|
||||
-- Case3 : false
|
||||
-- Case4 : true
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new enum E:
|
||||
-- Case1
|
||||
|
||||
new enum F:
|
||||
-- Case1 content int
|
||||
-- Case2
|
||||
|
||||
new scope A:
|
||||
param e content E
|
||||
param f content F
|
||||
param x content int
|
||||
|
||||
scope A:
|
||||
def e := E.Case1
|
||||
def f := F.Case1 content 2
|
||||
def x := match f with
|
||||
-- F.Case1 of i : i
|
||||
-- Case2 : 3
|
||||
```
|
22
tests/test_enum/good/disambiguated_cases.catala_en
Normal file
22
tests/test_enum/good/disambiguated_cases.catala_en
Normal file
@ -0,0 +1,22 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
declaration enumeration E:
|
||||
-- Case1
|
||||
|
||||
declaration enumeration F:
|
||||
-- Case1 content integer
|
||||
-- Case2
|
||||
|
||||
declaration scope A:
|
||||
context e content E
|
||||
context f content F
|
||||
context x content integer
|
||||
|
||||
scope A:
|
||||
definition e equals E.Case1
|
||||
definition f equals F.Case1 content 2
|
||||
definition x equals match f with pattern
|
||||
-- F.Case1 of i : i
|
||||
-- Case2 : 3
|
||||
```
|
@ -1,17 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new enum E:
|
||||
-- Case1 content int
|
||||
-- Case2
|
||||
|
||||
new scope A:
|
||||
param x content E
|
||||
param y content bool
|
||||
param z content bool
|
||||
|
||||
scope A:
|
||||
def x := Case1 content 2
|
||||
def y := x with Case1
|
||||
def z := x with Case2
|
||||
```
|
17
tests/test_enum/good/quick_pattern_check.catala_en
Normal file
17
tests/test_enum/good/quick_pattern_check.catala_en
Normal file
@ -0,0 +1,17 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
declaration enumeration E:
|
||||
-- Case1 content integer
|
||||
-- Case2
|
||||
|
||||
declaration scope A:
|
||||
context x content E
|
||||
context y content boolean
|
||||
context z content boolean
|
||||
|
||||
scope A:
|
||||
definition x equals Case1 content 2
|
||||
definition y equals x with pattern Case1
|
||||
definition z equals x with pattern Case2
|
||||
```
|
@ -1,17 +0,0 @@
|
||||
## Article
|
||||
|
||||
```catala
|
||||
new enum E:
|
||||
-- Case1 content int
|
||||
-- Case2
|
||||
|
||||
new scope A:
|
||||
param x content E
|
||||
param y content int
|
||||
|
||||
scope A:
|
||||
def x := Case1 content 2
|
||||
def y := match x with
|
||||
-- Case1 of i : 42
|
||||
-- Case2 : 43
|
||||
```
|
17
tests/test_enum/good/simple.catala_en
Normal file
17
tests/test_enum/good/simple.catala_en
Normal file
@ -0,0 +1,17 @@
|
||||
## 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 equals match x with pattern
|
||||
-- Case1 of i : 42
|
||||
-- Case2 : 43
|
||||
```
|
@ -1,14 +0,0 @@
|
||||
## Test
|
||||
|
||||
```catala
|
||||
new scope A:
|
||||
param x content int
|
||||
|
||||
scope A:
|
||||
def x := 0
|
||||
|
||||
def x := 1
|
||||
|
||||
exception
|
||||
def x := 2
|
||||
```
|
@ -0,0 +1,14 @@
|
||||
## Test
|
||||
|
||||
```catala
|
||||
declaration scope A:
|
||||
context x content integer
|
||||
|
||||
scope A:
|
||||
definition x equals 0
|
||||
|
||||
definition x equals 1
|
||||
|
||||
exception
|
||||
definition x equals 2
|
||||
```
|
@ -1,14 +0,0 @@
|
||||
## Test
|
||||
|
||||
```catala
|
||||
new scope A:
|
||||
param x content int
|
||||
param y content int
|
||||
|
||||
scope A:
|
||||
label base_y
|
||||
def y := 0
|
||||
|
||||
exception base_y
|
||||
def x := 1
|
||||
```
|
14
tests/test_exception/bad/dangling_exception.catala_en
Normal file
14
tests/test_exception/bad/dangling_exception.catala_en
Normal file
@ -0,0 +1,14 @@
|
||||
## Test
|
||||
|
||||
```catala
|
||||
declaration scope A:
|
||||
context x content integer
|
||||
context y content integer
|
||||
|
||||
scope A:
|
||||
label base_y
|
||||
definition y equals 0
|
||||
|
||||
exception base_y
|
||||
definition x equals 1
|
||||
```
|
@ -1,19 +1,19 @@
|
||||
## Test
|
||||
|
||||
```catala
|
||||
new scope A:
|
||||
param x content int
|
||||
declaration scope A:
|
||||
context x content integer
|
||||
|
||||
scope A:
|
||||
label base_x
|
||||
exception exception_exception_x
|
||||
def x := 0
|
||||
definition x equals 0
|
||||
|
||||
label exception_x
|
||||
exception base_x
|
||||
def x := 1
|
||||
definition x equals 1
|
||||
|
||||
label exception_exception_x
|
||||
exception exception_x
|
||||
def x := 2
|
||||
definition x equals 2
|
||||
```
|
@ -1,10 +0,0 @@
|
||||
## Test
|
||||
|
||||
```catala
|
||||
new scope A:
|
||||
param x content int
|
||||
|
||||
scope A:
|
||||
exception
|
||||
def x := 1
|
||||
```
|
@ -0,0 +1,10 @@
|
||||
## Test
|
||||
|
||||
```catala
|
||||
declaration scope A:
|
||||
context x content integer
|
||||
|
||||
scope A:
|
||||
exception
|
||||
definition x equals 1
|
||||
```
|
@ -1,20 +0,0 @@
|
||||
## Test
|
||||
|
||||
```catala
|
||||
new scope A:
|
||||
param x content int
|
||||
param y content int
|
||||
|
||||
scope A:
|
||||
def x := 0
|
||||
|
||||
exception
|
||||
def x := 1
|
||||
|
||||
def y := 2
|
||||
|
||||
def y := 4
|
||||
|
||||
exception
|
||||
def y := 3
|
||||
```
|
20
tests/test_exception/bad/one_ambiguous_exception.catala_en
Normal file
20
tests/test_exception/bad/one_ambiguous_exception.catala_en
Normal file
@ -0,0 +1,20 @@
|
||||
## Test
|
||||
|
||||
```catala
|
||||
declaration scope A:
|
||||
context x content integer
|
||||
context y content integer
|
||||
|
||||
scope A:
|
||||
definition x equals 0
|
||||
|
||||
exception
|
||||
definition x equals 1
|
||||
|
||||
definition y equals 2
|
||||
|
||||
definition y equals 4
|
||||
|
||||
exception
|
||||
definition y equals 3
|
||||
```
|
@ -1,28 +1,28 @@
|
||||
[ERROR] This exception can refer to several definitions. Try using labels to disambiguate
|
||||
[ERROR]
|
||||
[ERROR] Ambiguous exception
|
||||
[ERROR] --> test_exception/bad/ambiguous_unlabeled_exception.catala
|
||||
[ERROR] --> test_exception/bad/ambiguous_unlabeled_exception.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 10 | def x := 1
|
||||
[ERROR] |
|
||||
[ERROR] 10 | definition x equals 1
|
||||
[ERROR] |
|
||||
[ERROR] 11 |
|
||||
[ERROR] |
|
||||
[ERROR] 12 | exception
|
||||
[ERROR] | ^^^^^^^^^
|
||||
[ERROR] 13 | def x := 2
|
||||
[ERROR] | ^^^^^^^^^^^
|
||||
[ERROR] 13 | definition x equals 2
|
||||
[ERROR] | ^^^^^^^^^^^^^^^^^^^^^^
|
||||
[ERROR] + Test
|
||||
[ERROR]
|
||||
[ERROR] Candidate definition
|
||||
[ERROR] --> test_exception/bad/ambiguous_unlabeled_exception.catala
|
||||
[ERROR] --> test_exception/bad/ambiguous_unlabeled_exception.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 10 | def x := 1
|
||||
[ERROR] | ^
|
||||
[ERROR] 10 | definition x equals 1
|
||||
[ERROR] | ^
|
||||
[ERROR] + Test
|
||||
[ERROR]
|
||||
[ERROR] Candidate definition
|
||||
[ERROR] --> test_exception/bad/ambiguous_unlabeled_exception.catala
|
||||
[ERROR] --> test_exception/bad/ambiguous_unlabeled_exception.catala_en
|
||||
[ERROR] |
|
||||
[ERROR] 8 | def x := 0
|
||||
[ERROR] | ^
|
||||
[ERROR] 8 | definition x equals 0
|
||||
[ERROR] | ^
|
||||
[ERROR] + Test
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user