Disable recursive tests reset for now; remove rel paths in test out

This commit is contained in:
Louis Gesbert 2023-07-18 16:49:17 +02:00
parent fa33d37d84
commit edd6dce0d8
113 changed files with 272 additions and 265 deletions

View File

@ -98,7 +98,8 @@ let rec has_inline_tests ?(parents = []) (file : string) : bool =
let has_inline_tests file = has_inline_tests file (* hide optional parameter *)
let [@ocamlformat "disable"] rec scan_for_inline_tests ?(parents=[]) (file : string)
let [@ocamlformat "disable"] rec scan_for_inline_tests
?(parents=[]) (file : string)
: file_tests list =
let parents, file = checkfile parents file in
let read_file ic =
@ -138,7 +139,8 @@ let [@ocamlformat "disable"] rec scan_for_inline_tests ?(parents=[]) (file : str
1
(String.sub file_str 0 pos)
in
Message.raise_error "Bad inline-test format at %s line %d" file line
Message.raise_error "Bad inline-test format at %s line %d"
file line
in
let params =
List.filter (( <> ) "")
@ -179,12 +181,14 @@ let run_inline_tests
(file : string)
(catala_exe : string)
(catala_opts : string list) =
let _, file = checkfile [] file in
match scan_for_inline_tests file with
| [] -> Message.emit_warning "No inline tests found in %s" file
| file_tests ->
Message.emit_debug "@[<v 2>Running tests:@ %a@]"
(Format.pp_print_list (fun ppf t -> Format.fprintf ppf "- @[<hov>%s:@ %d tests@]"
t.filename (List.length t.tests)))
(Format.pp_print_list
(fun ppf t -> Format.fprintf ppf "- @[<hov>%s:@ %d tests@]"
t.filename (List.length t.tests)))
file_tests;
let run test oc =
List.iter
@ -192,6 +196,8 @@ let run_inline_tests
output_string oc test.text_before;
let cmd_out_rd, cmd_out_wr = Unix.pipe () in
let ic = Unix.in_channel_of_descr cmd_out_rd in
let file_dir, file = Filename.dirname file, Filename.basename file in
let catala_exe = Unix.realpath catala_exe in
let cmd =
Array.of_list ((catala_exe :: catala_opts) @ test.params @ [file])
in
@ -206,6 +212,9 @@ let run_inline_tests
|> Array.of_seq
in
let pid =
let cwd = Unix.getcwd () in
Unix.chdir file_dir;
Fun.protect ~finally:(fun () -> Unix.chdir cwd) @@ fun () ->
Unix.create_process_env catala_exe cmd env Unix.stdin cmd_out_wr
cmd_out_wr
in
@ -237,7 +246,8 @@ let run_inline_tests
in
List.iter
(fun test ->
if reset then (
if test.filename <> file then ()
else if reset then (
let out = test.filename ^ ".out" in
(try File.with_out_channel out (run test)
with e ->

View File

@ -35,13 +35,13 @@ You could have written : "condition",
or "content"
Error token:
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.21-11.26:
┌─⯈ test_nsw_social_housie.catala_en:11.21-11.26:
└──┐
11 │ context my_gaming scope GamingAuthorized
│ ‾‾‾‾‾
Last good token:
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.11-11.20:
┌─⯈ test_nsw_social_housie.catala_en:11.11-11.20:
└──┐
11 │ context my_gaming scope GamingAuthorized
│ ‾‾‾‾‾‾‾‾‾
@ -79,13 +79,13 @@ You could have written : "condition",
or "content"
Error token:
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.21-11.26:
┌─⯈ test_nsw_social_housie.catala_en:11.21-11.26:
└──┐
11 │ context my_gaming scope GamingAuthorized
│ ‾‾‾‾‾
Last good token:
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.11-11.20:
┌─⯈ test_nsw_social_housie.catala_en:11.11-11.20:
└──┐
11 │ context my_gaming scope GamingAuthorized
│ ‾‾‾‾‾‾‾‾‾
@ -123,13 +123,13 @@ You could have written : "condition",
or "content"
Error token:
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.21-11.26:
┌─⯈ test_nsw_social_housie.catala_en:11.21-11.26:
└──┐
11 │ context my_gaming scope GamingAuthorized
│ ‾‾‾‾‾
Last good token:
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.11-11.20:
┌─⯈ test_nsw_social_housie.catala_en:11.11-11.20:
└──┐
11 │ context my_gaming scope GamingAuthorized
│ ‾‾‾‾‾‾‾‾‾
@ -169,13 +169,13 @@ You could have written : "condition",
or "content"
Error token:
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.21-11.26:
┌─⯈ test_nsw_social_housie.catala_en:11.21-11.26:
└──┐
11 │ context my_gaming scope GamingAuthorized
│ ‾‾‾‾‾
Last good token:
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.11-11.20:
┌─⯈ test_nsw_social_housie.catala_en:11.11-11.20:
└──┐
11 │ context my_gaming scope GamingAuthorized
│ ‾‾‾‾‾‾‾‾‾

View File

@ -37,7 +37,7 @@ $ catala Interpret -s Dec
division by zero at runtime
The division operator:
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:20.23-20.30:
┌─⯈ division_by_zero.catala_en:20.23-20.30:
└──┐
20 │ definition i equals 1. / 0.
│ ‾‾‾‾‾‾‾
@ -45,7 +45,7 @@ The division operator:
└─ with decimals
The null denominator:
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:20.28-20.30:
┌─⯈ division_by_zero.catala_en:20.28-20.30:
└──┐
20 │ definition i equals 1. / 0.
│ ‾‾
@ -60,7 +60,7 @@ $ catala Interpret -s Int
division by zero at runtime
The division operator:
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:10.23-10.28:
┌─⯈ division_by_zero.catala_en:10.23-10.28:
└──┐
10 │ definition i equals 1 / 0
│ ‾‾‾‾‾
@ -68,7 +68,7 @@ The division operator:
└─ with integers
The null denominator:
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:10.27-10.28:
┌─⯈ division_by_zero.catala_en:10.27-10.28:
└──┐
10 │ definition i equals 1 / 0
│ ‾
@ -83,7 +83,7 @@ $ catala Interpret -s Money
division by zero at runtime
The division operator:
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:30.23-30.35:
┌─⯈ division_by_zero.catala_en:30.23-30.35:
└──┐
30 │ definition i equals $10.0 / $0.0
│ ‾‾‾‾‾‾‾‾‾‾‾‾
@ -91,7 +91,7 @@ The division operator:
└─ with money
The null denominator:
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:30.31-30.35:
┌─⯈ division_by_zero.catala_en:30.31-30.35:
└──┐
30 │ definition i equals $10.0 / $0.0
│ ‾‾‾‾

View File

@ -11,12 +11,12 @@ $ catala typecheck
[ERROR]
Please add parentheses to explicit which of these operators should be applied first
┌─⯈ tests/test_arithmetic/bad/logical_prio.catala_en:6.28-6.31:
┌─⯈ logical_prio.catala_en:6.28-6.31:
└─┐
6 │ definition o equals true and (false and true and true) or false
│ ‾‾‾
┌─⯈ tests/test_arithmetic/bad/logical_prio.catala_en:6.58-6.60:
┌─⯈ logical_prio.catala_en:6.58-6.60:
└─┐
6 │ definition o equals true and (false and true and true) or false
│ ‾‾

View File

@ -16,21 +16,21 @@ $ catala Interpret -s A
I don't know how to apply operator >= on types integer and
money
┌─⯈ tests/test_array/bad/fold_error.catala_en:10.50-10.52:
┌─⯈ fold_error.catala_en:10.50-10.52:
└──┐
10 │ definition list_high_count equals number of (m >= $7) for m among list
│ ‾‾
└─ Article
Type integer coming from expression:
┌─⯈ tests/test_array/bad/fold_error.catala_en:5.35-5.42:
┌─⯈ fold_error.catala_en:5.35-5.42:
└─┐
5 │ context list content collection integer
│ ‾‾‾‾‾‾‾
└─ Article
Type money coming from expression:
┌─⯈ tests/test_array/bad/fold_error.catala_en:10.53-10.55:
┌─⯈ fold_error.catala_en:10.53-10.55:
└──┐
10 │ definition list_high_count equals number of (m >= $7) for m among list
│ ‾‾

View File

@ -18,21 +18,21 @@ Error during typechecking, incompatible types:
└─⯈ bool
Error coming from typechecking the following expression:
┌─⯈ tests/test_bool/bad/bad_assert.catala_en:9.13-9.14:
┌─⯈ bad_assert.catala_en:9.13-9.14:
└─┐
9 │ assertion x
│ ‾
└─ Test
Type integer coming from expression:
┌─⯈ tests/test_bool/bad/bad_assert.catala_en:5.20-5.27:
┌─⯈ bad_assert.catala_en:5.20-5.27:
└─┐
5 │ output x content integer
│ ‾‾‾‾‾‾‾
└─ Test
Type bool coming from expression:
┌─⯈ tests/test_bool/bad/bad_assert.catala_en:9.13-9.14:
┌─⯈ bad_assert.catala_en:9.13-9.14:
└─┐
9 │ assertion x
│ ‾

View File

@ -16,21 +16,21 @@ Error during typechecking, incompatible types:
└─⯈ bool
Error coming from typechecking the following expression:
┌─⯈ tests/test_bool/bad/test_xor_with_int.catala_en:8.30-8.32:
┌─⯈ test_xor_with_int.catala_en:8.30-8.32:
└─┐
8 │ definition test_var equals 10 xor 20
│ ‾‾
└─ 'xor' should be a boolean operator
Type integer coming from expression:
┌─⯈ tests/test_bool/bad/test_xor_with_int.catala_en:8.30-8.32:
┌─⯈ test_xor_with_int.catala_en:8.30-8.32:
└─┐
8 │ definition test_var equals 10 xor 20
│ ‾‾
└─ 'xor' should be a boolean operator
Type bool coming from expression:
┌─⯈ tests/test_bool/bad/test_xor_with_int.catala_en:8.33-8.36:
┌─⯈ test_xor_with_int.catala_en:8.33-8.36:
└─┐
8 │ definition test_var equals 10 xor 20
│ ‾‾‾

View File

@ -28,12 +28,12 @@ $ catala Interpret -s Test
[ERROR]
You cannot set multiple date rounding modes
┌─⯈ tests/test_date/bad/rounding_option_conflict.catala_en:10.14-10.24:
┌─⯈ rounding_option_conflict.catala_en:10.14-10.24:
└──┐
10 │ date round decreasing
│ ‾‾‾‾‾‾‾‾‾‾
┌─⯈ tests/test_date/bad/rounding_option_conflict.catala_en:12.14-12.24:
┌─⯈ rounding_option_conflict.catala_en:12.14-12.24:
└──┐
12 │ date round increasing
│ ‾‾‾‾‾‾‾‾‾‾

View File

@ -45,14 +45,14 @@ $ catala Interpret -s Ge
[ERROR]
Cannot compare together durations that cannot be converted to a precise number of days
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:40.23-40.30:
┌─⯈ uncomparable_duration.catala_en:40.23-40.30:
└──┐
40 │ definition d equals 1 month >= 2 day
│ ‾‾‾‾‾‾‾
└┬ `UncomparableDurations` exception management
└─ `>=` operator
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:40.34-40.39:
┌─⯈ uncomparable_duration.catala_en:40.34-40.39:
└──┐
40 │ definition d equals 1 month >= 2 day
│ ‾‾‾‾‾
@ -66,14 +66,14 @@ $ catala Interpret -s Gt
[ERROR]
Cannot compare together durations that cannot be converted to a precise number of days
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:30.23-30.30:
┌─⯈ uncomparable_duration.catala_en:30.23-30.30:
└──┐
30 │ definition d equals 1 month > 2 day
│ ‾‾‾‾‾‾‾
└┬ `UncomparableDurations` exception management
└─ `<=` operator
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:30.33-30.38:
┌─⯈ uncomparable_duration.catala_en:30.33-30.38:
└──┐
30 │ definition d equals 1 month > 2 day
│ ‾‾‾‾‾
@ -87,14 +87,14 @@ $ catala Interpret -s Le
[ERROR]
Cannot compare together durations that cannot be converted to a precise number of days
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:20.23-20.30:
┌─⯈ uncomparable_duration.catala_en:20.23-20.30:
└──┐
20 │ definition d equals 1 month <= 2 day
│ ‾‾‾‾‾‾‾
└┬ `UncomparableDurations` exception management
└─ `<=` operator
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:20.34-20.39:
┌─⯈ uncomparable_duration.catala_en:20.34-20.39:
└──┐
20 │ definition d equals 1 month <= 2 day
│ ‾‾‾‾‾
@ -108,14 +108,14 @@ $ catala Interpret -s Lt
[ERROR]
Cannot compare together durations that cannot be converted to a precise number of days
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:10.23-10.30:
┌─⯈ uncomparable_duration.catala_en:10.23-10.30:
└──┐
10 │ definition d equals 1 month < 2 day
│ ‾‾‾‾‾‾‾
└┬ `UncomparableDurations` exception management
└─ `<` operator
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:10.33-10.38:
┌─⯈ uncomparable_duration.catala_en:10.33-10.38:
└──┐
10 │ definition d equals 1 month < 2 day
│ ‾‾‾‾‾

View File

@ -11,8 +11,8 @@ scope A:
```catala-test-inline
$ catala Interpret -s A --message=gnu
tests/test_default/bad/conflict.catala_en:8.56-8.57: [ERROR] There is a conflict between multiple valid consequences for assigning the same variable.
tests/test_default/bad/conflict.catala_en:8.56-8.57: [ERROR] This consequence has a valid justification:
tests/test_default/bad/conflict.catala_en:9.56-9.57: [ERROR] This consequence has a valid justification:
conflict.catala_en:8.56-8.57: [ERROR] There is a conflict between multiple valid consequences for assigning the same variable.
conflict.catala_en:8.56-8.57: [ERROR] This consequence has a valid justification:
conflict.catala_en:9.56-9.57: [ERROR] This consequence has a valid justification:
#return code 123#
```

View File

@ -13,7 +13,7 @@ scope A:
$ catala Interpret -s A
[WARNING] In scope "A", the variable "y" is declared but never defined; did you forget something?
┌─⯈ tests/test_default/bad/empty.catala_en:6.10-6.11:
┌─⯈ empty.catala_en:6.10-6.11:
└─┐
6 │ output y content boolean
│ ‾
@ -21,7 +21,7 @@ $ catala Interpret -s A
[ERROR]
This variable evaluated to an empty term (no rule that defined it applied in this situation)
┌─⯈ tests/test_default/bad/empty.catala_en:6.10-6.11:
┌─⯈ empty.catala_en:6.10-6.11:
└─┐
6 │ output y content boolean
│ ‾

View File

@ -17,7 +17,7 @@ $ catala Interpret -s A
[ERROR]
This variable evaluated to an empty term (no rule that defined it applied in this situation)
┌─⯈ tests/test_default/bad/empty_with_rules.catala_en:5.10-5.11:
┌─⯈ empty_with_rules.catala_en:5.10-5.11:
└─┐
5 │ output x content integer
│ ‾

View File

@ -21,13 +21,13 @@ or "under condition",
or "."
Error token:
┌─⯈ tests/test_default/bad/typing_or_logical_error.catala_en:8.30-8.31:
┌─⯈ typing_or_logical_error.catala_en:8.30-8.31:
└─┐
8 │ definition wrong_definition = 1
│ ‾
Last good token:
┌─⯈ tests/test_default/bad/typing_or_logical_error.catala_en:8.13-8.29:
┌─⯈ typing_or_logical_error.catala_en:8.13-8.29:
└─┐
8 │ definition wrong_definition = 1
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

View File

@ -13,12 +13,12 @@ scope A:
$ catala Interpret -s A
[WARNING] These definitions have identical justifications and consequences; is it a mistake?
┌─⯈ tests/test_default/good/mutliple_definitions.catala_en:9.3-9.15:
┌─⯈ mutliple_definitions.catala_en:9.3-9.15:
└─┐
9 │ definition w equals 3
│ ‾‾‾‾‾‾‾‾‾‾‾‾
┌─⯈ tests/test_default/good/mutliple_definitions.catala_en:6.3-6.15:
┌─⯈ mutliple_definitions.catala_en:6.3-6.15:
└─┐
6 │ definition w equals 3
│ ‾‾‾‾‾‾‾‾‾‾‾‾

View File

@ -19,7 +19,7 @@ $ catala Interpret -s A
[ERROR]
This constructor name is ambiguous, it can belong to E or F. Desambiguate it by prefixing it with the enum name.
┌─⯈ tests/test_enum/bad/ambiguous_cases.catala_en:14.23-14.28:
┌─⯈ ambiguous_cases.catala_en:14.23-14.28:
└──┐
14 │ definition e equals Case1
│ ‾‾‾‾‾

View File

@ -20,7 +20,7 @@ $ catala Interpret -s A
[ERROR]
Couldn't infer the enumeration name from lonely wildcard (wildcard cannot be used as single match case)
┌─⯈ tests/test_enum/bad/ambiguous_wildcard.catala_en:15.5-15.21:
┌─⯈ ambiguous_wildcard.catala_en:15.5-15.21:
└──┐
15 │ -- anything : 31
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

View File

@ -23,13 +23,13 @@ $ catala Interpret -s A
[ERROR]
The constructor Case3 has been matched twice:
┌─⯈ tests/test_enum/bad/duplicate_case.catala_en:18.16-18.20:
┌─⯈ duplicate_case.catala_en:18.16-18.20:
└──┐
18 │ -- Case3 : true
│ ‾‾‾‾
└─ Article
┌─⯈ tests/test_enum/bad/duplicate_case.catala_en:17.16-17.21:
┌─⯈ duplicate_case.catala_en:17.16-17.21:
└──┐
17 │ -- Case3 : false
│ ‾‾‾‾‾

View File

@ -12,7 +12,7 @@ $ catala Typecheck
[ERROR]
The enum Foo does not have any cases; give it some for Catala to be able to accept it.
┌─⯈ tests/test_enum/bad/empty.catala_en:4.25-4.28:
┌─⯈ empty.catala_en:4.25-4.28:
└─┐
4 │ declaration enumeration Foo:
│ ‾‾‾

View File

@ -20,7 +20,7 @@ scope A:
$ catala Interpret -s A
[WARNING] The constructor "Case3" of enumeration "E" is never used; maybe it's unnecessary?
┌─⯈ tests/test_enum/bad/missing_case.catala_en:7.6-7.11:
┌─⯈ missing_case.catala_en:7.6-7.11:
└─┐
7 │ -- Case3
│ ‾‾‾‾‾
@ -28,7 +28,7 @@ $ catala Interpret -s A
[ERROR]
The constructor Case3 of enum E is missing from this pattern matching
┌─⯈ tests/test_enum/bad/missing_case.catala_en:14.25-16.22:
┌─⯈ missing_case.catala_en:14.25-16.22:
└──┐
14 │ definition out equals match e with pattern
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

View File

@ -42,7 +42,7 @@ $ catala Interpret -s First_case
Wildcard must be the last match case
Not ending wildcard:
┌─⯈ tests/test_enum/bad/not_ending_wildcard.catala_en:19.5-19.21:
┌─⯈ not_ending_wildcard.catala_en:19.5-19.21:
└──┐
19 │ -- anything : 31
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
@ -50,7 +50,7 @@ Not ending wildcard:
└─ Wildcard can't be the first case
Next reachable case:
┌─⯈ tests/test_enum/bad/not_ending_wildcard.catala_en:20.5-20.18:
┌─⯈ not_ending_wildcard.catala_en:20.5-20.18:
└──┐
20 │ -- Case2 : 42
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾
@ -65,7 +65,7 @@ $ catala Interpret -s Middle_case
Wildcard must be the last match case
Not ending wildcard:
┌─⯈ tests/test_enum/bad/not_ending_wildcard.catala_en:19.5-19.21:
┌─⯈ not_ending_wildcard.catala_en:19.5-19.21:
└──┐
19 │ -- anything : 31
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
@ -73,7 +73,7 @@ Not ending wildcard:
└─ Wildcard can't be the first case
Next reachable case:
┌─⯈ tests/test_enum/bad/not_ending_wildcard.catala_en:20.5-20.18:
┌─⯈ not_ending_wildcard.catala_en:20.5-20.18:
└──┐
20 │ -- Case2 : 42
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾

View File

@ -36,21 +36,21 @@ Error during typechecking, incompatible types:
└─⯈ F
Error coming from typechecking the following expression:
┌─⯈ tests/test_enum/bad/quick_pattern_2.catala_en:28.23-28.24:
┌─⯈ quick_pattern_2.catala_en:28.23-28.24:
└──┐
28 │ definition y equals x with pattern Case3
│ ‾
└─ Article
Type E coming from expression:
┌─⯈ tests/test_enum/bad/quick_pattern_2.catala_en:17.21-17.22:
┌─⯈ quick_pattern_2.catala_en:17.21-17.22:
└──┐
17 │ context x content E
│ ‾
└─ Article
Type F coming from expression:
┌─⯈ tests/test_enum/bad/quick_pattern_2.catala_en:28.23-28.43:
┌─⯈ quick_pattern_2.catala_en:28.23-28.43:
└──┐
28 │ definition y equals x with pattern Case3
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

View File

@ -26,21 +26,21 @@ Error during typechecking, incompatible types:
└─⯈ F
Error coming from typechecking the following expression:
┌─⯈ tests/test_enum/bad/quick_pattern_3.catala_en:18.21-18.22:
┌─⯈ quick_pattern_3.catala_en:18.21-18.22:
└──┐
18 │ definition y equals x with pattern Case3
│ ‾
└─ Article
Type E coming from expression:
┌─⯈ tests/test_enum/bad/quick_pattern_3.catala_en:13.19-13.20:
┌─⯈ quick_pattern_3.catala_en:13.19-13.20:
└──┐
13 │ context x content E
│ ‾
└─ Article
Type F coming from expression:
┌─⯈ tests/test_enum/bad/quick_pattern_3.catala_en:18.21-18.41:
┌─⯈ quick_pattern_3.catala_en:18.21-18.41:
└──┐
18 │ definition y equals x with pattern Case3
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

View File

@ -25,21 +25,21 @@ Error during typechecking, incompatible types:
└─⯈ F
Error coming from typechecking the following expression:
┌─⯈ tests/test_enum/bad/quick_pattern_4.catala_en:17.21-17.22:
┌─⯈ quick_pattern_4.catala_en:17.21-17.22:
└──┐
17 │ definition y equals x with pattern Case3
│ ‾
└─ Test
Type E coming from expression:
┌─⯈ tests/test_enum/bad/quick_pattern_4.catala_en:12.19-12.20:
┌─⯈ quick_pattern_4.catala_en:12.19-12.20:
└──┐
12 │ context x content E
│ ‾
└─ Test
Type F coming from expression:
┌─⯈ tests/test_enum/bad/quick_pattern_4.catala_en:17.21-17.41:
┌─⯈ quick_pattern_4.catala_en:17.21-17.41:
└──┐
17 │ definition y equals x with pattern Case3
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

View File

@ -22,7 +22,7 @@ The name of this constructor has not been defined before
(it's probably a typographical error).
Here is your code :
┌─⯈ tests/test_enum/bad/quick_pattern_fail.catala_en:15.38-15.43:
┌─⯈ quick_pattern_fail.catala_en:15.38-15.43:
└──┐
15 │ definition y equals x with pattern Case3
│ ‾‾‾‾‾

View File

@ -26,7 +26,7 @@ $ catala Interpret -s A
[ERROR]
This case matches a constructor of enumeration E but previous case were matching constructors of enumeration F
┌─⯈ tests/test_enum/bad/too_many_cases.catala_en:21.8-21.13:
┌─⯈ too_many_cases.catala_en:21.8-21.13:
└──┐
21 │ -- Case4 : true
│ ‾‾‾‾‾

View File

@ -21,7 +21,7 @@ scope A:
$ catala Interpret -s A
[WARNING] Unreachable match case, all constructors of the enumeration E are already specified
┌─⯈ tests/test_enum/bad/useless_wildcard.catala_en:17.5-17.21:
┌─⯈ useless_wildcard.catala_en:17.5-17.21:
└──┐
17 │ -- anything : 31
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

View File

@ -18,7 +18,7 @@ The name of this constructor has not been defined before
(it's probably a typographical error).
Here is your code :
┌─⯈ tests/test_enum/bad/wrong_cons.catala_en:11.23-11.28:
┌─⯈ wrong_cons.catala_en:11.23-11.28:
└──┐
11 │ definition e equals Case2
│ ‾‾‾‾‾

View File

@ -19,7 +19,7 @@ $ catala Interpret -s A
This exception can refer to several definitions. Try using labels to disambiguate
Ambiguous exception
┌─⯈ tests/test_exception/bad/ambiguous_unlabeled_exception.catala_en:12.3-13.15:
┌─⯈ ambiguous_unlabeled_exception.catala_en:12.3-13.15:
└──┐
12 │ exception
│ ‾‾‾‾‾‾‾‾‾
@ -28,14 +28,14 @@ Ambiguous exception
└─ Test
Candidate definition
┌─⯈ tests/test_exception/bad/ambiguous_unlabeled_exception.catala_en:10.14-10.15:
┌─⯈ ambiguous_unlabeled_exception.catala_en:10.14-10.15:
└──┐
10 │ definition x equals 1
│ ‾
└─ Test
Candidate definition
┌─⯈ tests/test_exception/bad/ambiguous_unlabeled_exception.catala_en:8.14-8.15:
┌─⯈ ambiguous_unlabeled_exception.catala_en:8.14-8.15:
└─┐
8 │ definition x equals 0
│ ‾

View File

@ -18,7 +18,7 @@ $ catala Interpret -s A
[ERROR]
Unknown label for the scope variable x: "base_y"
┌─⯈ tests/test_exception/bad/dangling_exception.catala_en:12.13-12.19:
┌─⯈ dangling_exception.catala_en:12.13-12.19:
└──┐
12 │ exception base_y
│ ‾‾‾‾‾‾

View File

@ -23,7 +23,7 @@ $ catala Interpret -s A
[ERROR]
Exception cycle detected when defining x: each of these 3 exceptions applies over the previous one, and the first applies over the last
┌─⯈ tests/test_exception/bad/exceptions_cycle.catala_en:8.3-10.15:
┌─⯈ exceptions_cycle.catala_en:8.3-10.15:
└──┐
8 │ label base_x
│ ‾‾‾‾‾‾‾‾‾‾‾‾
@ -32,7 +32,7 @@ Exception cycle detected when defining x: each of these 3 exceptions applies ove
10 │ definition x equals 0
│ ‾‾‾‾‾‾‾‾‾‾‾‾
┌─⯈ tests/test_exception/bad/exceptions_cycle.catala_en:12.3-14.15:
┌─⯈ exceptions_cycle.catala_en:12.3-14.15:
└──┐
12 │ label exception_x
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
@ -41,7 +41,7 @@ Exception cycle detected when defining x: each of these 3 exceptions applies ove
14 │ definition x equals 1
│ ‾‾‾‾‾‾‾‾‾‾‾‾
┌─⯈ tests/test_exception/bad/exceptions_cycle.catala_en:16.3-18.15:
┌─⯈ exceptions_cycle.catala_en:16.3-18.15:
└──┐
16 │ label exception_exception_x
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

View File

@ -14,7 +14,7 @@ $ catala Interpret -s A
[ERROR]
This exception does not have a corresponding definition
┌─⯈ tests/test_exception/bad/missing_unlabeled_definition.catala_en:8.3-9.15:
┌─⯈ missing_unlabeled_definition.catala_en:8.3-9.15:
└─┐
8 │ exception
│ ‾‾‾‾‾‾‾‾‾

View File

@ -25,7 +25,7 @@ $ catala Interpret -s A
This exception can refer to several definitions. Try using labels to disambiguate
Ambiguous exception
┌─⯈ tests/test_exception/bad/one_ambiguous_exception.catala_en:18.3-19.15:
┌─⯈ one_ambiguous_exception.catala_en:18.3-19.15:
└──┐
18 │ exception
│ ‾‾‾‾‾‾‾‾‾
@ -34,14 +34,14 @@ Ambiguous exception
└─ Test
Candidate definition
┌─⯈ tests/test_exception/bad/one_ambiguous_exception.catala_en:16.14-16.15:
┌─⯈ one_ambiguous_exception.catala_en:16.14-16.15:
└──┐
16 │ definition y equals 4
│ ‾
└─ Test
Candidate definition
┌─⯈ tests/test_exception/bad/one_ambiguous_exception.catala_en:14.14-14.15:
┌─⯈ one_ambiguous_exception.catala_en:14.14-14.15:
└──┐
14 │ definition y equals 2
│ ‾

View File

@ -15,7 +15,7 @@ $ catala Interpret -s A
[ERROR]
Cannot define rule as an exception to itself
┌─⯈ tests/test_exception/bad/self_exception.catala_en:9.13-9.19:
┌─⯈ self_exception.catala_en:9.13-9.19:
└─┐
9 │ exception base_y
│ ‾‾‾‾‾‾

View File

@ -21,14 +21,14 @@ $ catala Interpret -s A
There is a conflict between multiple valid consequences for assigning the same variable.
This consequence has a valid justification:
┌─⯈ tests/test_exception/bad/two_exceptions.catala_en:12.23-12.24:
┌─⯈ two_exceptions.catala_en:12.23-12.24:
└──┐
12 │ definition x equals 1
│ ‾
└─ Test
This consequence has a valid justification:
┌─⯈ tests/test_exception/bad/two_exceptions.catala_en:15.23-15.24:
┌─⯈ two_exceptions.catala_en:15.23-15.24:
└──┐
15 │ definition x equals 2
│ ‾

View File

@ -14,13 +14,13 @@ scope Foo:
$ catala Scopelang -s Foo
[WARNING] These definitions have identical justifications and consequences; is it a mistake?
┌─⯈ tests/test_exception/good/double_definition.catala_en:9.3-9.15:
┌─⯈ double_definition.catala_en:9.3-9.15:
└─┐
9 │ definition x equals 1
│ ‾‾‾‾‾‾‾‾‾‾‾‾
└─ Foo
┌─⯈ tests/test_exception/good/double_definition.catala_en:8.3-8.15:
┌─⯈ double_definition.catala_en:8.3-8.15:
└─┐
8 │ definition x equals 1
│ ‾‾‾‾‾‾‾‾‾‾‾‾
@ -39,13 +39,13 @@ Dcalc translation below.
$ catala Dcalc -s Foo
[WARNING] These definitions have identical justifications and consequences; is it a mistake?
┌─⯈ tests/test_exception/good/double_definition.catala_en:9.3-9.15:
┌─⯈ double_definition.catala_en:9.3-9.15:
└─┐
9 │ definition x equals 1
│ ‾‾‾‾‾‾‾‾‾‾‾‾
└─ Foo
┌─⯈ tests/test_exception/good/double_definition.catala_en:8.3-8.15:
┌─⯈ double_definition.catala_en:8.3-8.15:
└─┐
8 │ definition x equals 1
│ ‾‾‾‾‾‾‾‾‾‾‾‾

View File

@ -50,36 +50,36 @@ $ catala Exceptions -s Foo -v x
Printing the tree of exceptions for the definitions of variable "x" of scope "Foo".
[RESULT]
Definitions with label "base":
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:9.3-9.26:
┌─⯈ groups_of_exceptions.catala_en:9.3-9.26:
└─┐
9 │ label base definition x under condition
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Test
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:13.3-13.26:
┌─⯈ groups_of_exceptions.catala_en:13.3-13.26:
└──┐
13 │ label base definition x under condition
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Test
[RESULT]
Definitions with label "intermediate":
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:17.3-17.49:
┌─⯈ groups_of_exceptions.catala_en:17.3-17.49:
└──┐
17 │ label intermediate exception base definition x under condition
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Test
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:21.3-21.49:
┌─⯈ groups_of_exceptions.catala_en:21.3-21.49:
└──┐
21 │ label intermediate exception base definition x under condition
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Test
[RESULT]
Definitions with label "exception_to_intermediate":
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:25.3-25.38:
┌─⯈ groups_of_exceptions.catala_en:25.3-25.38:
└──┐
25 │ exception intermediate definition x under condition
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Test
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:29.3-29.38:
┌─⯈ groups_of_exceptions.catala_en:29.3-29.38:
└──┐
29 │ exception intermediate definition x under condition
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

View File

@ -33,14 +33,14 @@ $ catala Interpret -s S
There is a conflict between multiple valid consequences for assigning the same variable.
This consequence has a valid justification:
┌─⯈ tests/test_func/bad/bad_func.catala_en:14.65-14.70:
┌─⯈ bad_func.catala_en:14.65-14.70:
└──┐
14 │ definition f of x under condition (x >= x) consequence equals x + x
│ ‾‾‾‾‾
└─ Article
This consequence has a valid justification:
┌─⯈ tests/test_func/bad/bad_func.catala_en:15.62-15.67:
┌─⯈ bad_func.catala_en:15.62-15.67:
└──┐
15 │ definition f of x under condition not b consequence equals x * x
│ ‾‾‾‾‾

View File

@ -18,13 +18,13 @@ $ catala typecheck
Function argument name mismatch between declaration ('x') and definition ('y')
Argument declared here:
┌─⯈ tests/test_func/bad/param_inconsistency.catala_en:4.42-4.43:
┌─⯈ param_inconsistency.catala_en:4.42-4.43:
└─┐
4 │ internal f1 content decimal depends on x content integer
│ ‾
Defined here:
┌─⯈ tests/test_func/bad/param_inconsistency.catala_en:10.20-10.21:
┌─⯈ param_inconsistency.catala_en:10.20-10.21:
└──┐
10 │ definition f1 of y under condition not cond
│ ‾

View File

@ -17,13 +17,13 @@ $ catala typecheck
Function argument name mismatch between declaration ('x') and definition ('y')
Argument declared here:
┌─⯈ tests/test_func/bad/param_inconsistency2.catala_en:4.42-4.43:
┌─⯈ param_inconsistency2.catala_en:4.42-4.43:
└─┐
4 │ internal f1 content decimal depends on x content integer
│ ‾
Defined here:
┌─⯈ tests/test_func/bad/param_inconsistency2.catala_en:9.30-9.31:
┌─⯈ param_inconsistency2.catala_en:9.30-9.31:
└─┐
9 │ exception definition f1 of y under condition not cond
│ ‾

View File

@ -17,13 +17,13 @@ $ catala typecheck
Function argument name mismatch between declaration ('x') and definition ('y')
Argument declared here:
┌─⯈ tests/test_func/bad/param_inconsistency3.catala_en:4.42-4.43:
┌─⯈ param_inconsistency3.catala_en:4.42-4.43:
└─┐
4 │ internal f1 content decimal depends on x content integer
│ ‾
Defined here:
┌─⯈ tests/test_func/bad/param_inconsistency3.catala_en:9.30-9.31:
┌─⯈ param_inconsistency3.catala_en:9.30-9.31:
└─┐
9 │ exception definition f1 of y under condition not cond
│ ‾

View File

@ -13,7 +13,7 @@ $ catala Interpret -s RecursiveFunc
[ERROR]
The variable f is used in one of its definitions, but recursion is forbidden in Catala
┌─⯈ tests/test_func/bad/recursive.catala_en:8.28-8.29:
┌─⯈ recursive.catala_en:8.28-8.29:
└─┐
8 │ definition f of x equals f of x + 1
│ ‾

View File

@ -21,21 +21,21 @@ $ catala Scopelang -s B
It is impossible to give a definition to a subscope variable not tagged as input or context.
Incriminated subscope:
┌─⯈ tests/test_func/good/context_func.catala_en:9.3-9.4:
┌─⯈ context_func.catala_en:9.3-9.4:
└─┐
9 │ a scope A
│ ‾
└─ Test
Incriminated variable:
┌─⯈ tests/test_func/good/context_func.catala_en:5.10-5.11:
┌─⯈ context_func.catala_en:5.10-5.11:
└─┐
5 │ output f content integer depends on x content integer
│ ‾
└─ Test
Incriminated subscope variable definition:
┌─⯈ tests/test_func/good/context_func.catala_en:15.3-15.17:
┌─⯈ context_func.catala_en:15.3-15.17:
└──┐
15 │ definition a.f of x under condition b and x > 0 consequence equals x - 1
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
@ -48,21 +48,21 @@ $ catala Dcalc -s A
It is impossible to give a definition to a subscope variable not tagged as input or context.
Incriminated subscope:
┌─⯈ tests/test_func/good/context_func.catala_en:9.3-9.4:
┌─⯈ context_func.catala_en:9.3-9.4:
└─┐
9 │ a scope A
│ ‾
└─ Test
Incriminated variable:
┌─⯈ tests/test_func/good/context_func.catala_en:5.10-5.11:
┌─⯈ context_func.catala_en:5.10-5.11:
└─┐
5 │ output f content integer depends on x content integer
│ ‾
└─ Test
Incriminated subscope variable definition:
┌─⯈ tests/test_func/good/context_func.catala_en:15.3-15.17:
┌─⯈ context_func.catala_en:15.3-15.17:
└──┐
15 │ definition a.f of x under condition b and x > 0 consequence equals x - 1
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
@ -75,21 +75,21 @@ $ catala Dcalc -s B
It is impossible to give a definition to a subscope variable not tagged as input or context.
Incriminated subscope:
┌─⯈ tests/test_func/good/context_func.catala_en:9.3-9.4:
┌─⯈ context_func.catala_en:9.3-9.4:
└─┐
9 │ a scope A
│ ‾
└─ Test
Incriminated variable:
┌─⯈ tests/test_func/good/context_func.catala_en:5.10-5.11:
┌─⯈ context_func.catala_en:5.10-5.11:
└─┐
5 │ output f content integer depends on x content integer
│ ‾
└─ Test
Incriminated subscope variable definition:
┌─⯈ tests/test_func/good/context_func.catala_en:15.3-15.17:
┌─⯈ context_func.catala_en:15.3-15.17:
└──┐
15 │ definition a.f of x under condition b and x > 0 consequence equals x - 1
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾

View File

@ -20,14 +20,14 @@ $ catala Typecheck
This subscope variable is a mandatory input but no definition was provided.
Incriminated subscope:
┌─⯈ tests/test_io/bad/forgot_input.catala_en:9.3-9.4:
┌─⯈ forgot_input.catala_en:9.3-9.4:
└─┐
9 │ a scope A
│ ‾
└─ Test
Incriminated variable:
┌─⯈ tests/test_io/bad/forgot_input.catala_en:6.9-6.10:
┌─⯈ forgot_input.catala_en:6.9-6.10:
└─┐
6 │ input x content integer
│ ‾

View File

@ -20,21 +20,21 @@ $ catala Typecheck
It is impossible to give a definition to a subscope variable not tagged as input or context.
Incriminated subscope:
┌─⯈ tests/test_io/bad/inputing_to_not_input.catala_en:8.3-8.4:
┌─⯈ inputing_to_not_input.catala_en:8.3-8.4:
└─┐
8 │ a scope A
│ ‾
└─ Test
Incriminated variable:
┌─⯈ tests/test_io/bad/inputing_to_not_input.catala_en:5.10-5.11:
┌─⯈ inputing_to_not_input.catala_en:5.10-5.11:
└─┐
5 │ output a content integer
│ ‾
└─ Test
Incriminated subscope variable definition:
┌─⯈ tests/test_io/bad/inputing_to_not_input.catala_en:14.3-14.17:
┌─⯈ inputing_to_not_input.catala_en:14.3-14.17:
└──┐
14 │ definition a.a equals 0
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾

View File

@ -13,14 +13,14 @@ $ catala Typecheck
It is impossible to give a definition to a scope variable tagged as input.
Incriminated variable:
┌─⯈ tests/test_io/bad/redefining_input.catala_en:5.16-5.17:
┌─⯈ redefining_input.catala_en:5.16-5.17:
└─┐
5 │ input output a content integer
│ ‾
└─ Test
Incriminated variable definition:
┌─⯈ tests/test_io/bad/redefining_input.catala_en:8.3-8.15:
┌─⯈ redefining_input.catala_en:8.3-8.15:
└─┐
8 │ definition a equals 0
│ ‾‾‾‾‾‾‾‾‾‾‾‾

View File

@ -17,7 +17,7 @@ scope B:
$ catala Typecheck
[WARNING] This variable is dead code; it does not contribute to computing any of scope "A" outputs. Did you forget something?
┌─⯈ tests/test_io/bad/using_non_output.catala_en:5.12-5.13:
┌─⯈ using_non_output.catala_en:5.12-5.13:
└─┐
5 │ internal a content integer
│ ‾
@ -26,21 +26,21 @@ $ catala Typecheck
The variable a.a cannot be used here, as it is not part of subscope a's results. Maybe you forgot to qualify it as an output?
Incriminated variable usage:
┌─⯈ tests/test_io/bad/using_non_output.catala_en:14.13-14.16:
┌─⯈ using_non_output.catala_en:14.13-14.16:
└──┐
14 │ assertion a.a = 0
│ ‾‾‾
└─ Test
Incriminated subscope variable declaration:
┌─⯈ tests/test_io/bad/using_non_output.catala_en:5.12-5.13:
┌─⯈ using_non_output.catala_en:5.12-5.13:
└─┐
5 │ internal a content integer
│ ‾
└─ Test
Incriminated subscope declaration:
┌─⯈ tests/test_io/bad/using_non_output.catala_en:8.3-8.4:
┌─⯈ using_non_output.catala_en:8.3-8.4:
└─┐
8 │ a scope A
│ ‾

View File

@ -18,21 +18,21 @@ $ catala Interpret -s A
I don't know how to apply operator * on types money and
money
┌─⯈ tests/test_money/bad/no_mingle.catala_en:12.26-12.27:
┌─⯈ no_mingle.catala_en:12.26-12.27:
└──┐
12 │ definition z equals (x * y)
│ ‾
└─ Article
Type money coming from expression:
┌─⯈ tests/test_money/bad/no_mingle.catala_en:5.21-5.26:
┌─⯈ no_mingle.catala_en:5.21-5.26:
└─┐
5 │ context x content money
│ ‾‾‾‾‾
└─ Article
Type money coming from expression:
┌─⯈ tests/test_money/bad/no_mingle.catala_en:6.21-6.26:
┌─⯈ no_mingle.catala_en:6.21-6.26:
└─┐
6 │ context y content money
│ ‾‾‾‾‾

View File

@ -16,7 +16,7 @@ $ catala typecheck
[ERROR]
Scope calls are not allowed outside of a scope
┌─⯈ tests/test_name_resolution/bad/toplevel_defs.catala_en:11.11-11.23:
┌─⯈ toplevel_defs.catala_en:11.11-11.23:
└──┐
11 │ equals (output of S1).a
│ ‾‾‾‾‾‾‾‾‾‾‾‾

View File

@ -62,9 +62,8 @@ let s (s_in: SIn.t) : S.t =
a_)))))
with
EmptyError -> (raise (NoValueProvided
{filename = "tests/test_name_resolution/good/let_in2.catala_en";
start_line=5; start_column=18; end_line=5; end_column=19;
law_headings=["Article"]})) in
{filename = "let_in2.catala_en"; start_line=5; start_column=18;
end_line=5; end_column=19; law_headings=["Article"]})) in
{S.a = a_}
let () =
Runtime_ocaml.Runtime.register_module "Let_in2"

View File

@ -384,7 +384,7 @@ def s2(s2_in:S2In):
law_headings=[]), [], temp_a_1, temp_a)
except EmptyError:
temp_a_2 = dead_value
raise NoValueProvided(SourcePosition(filename="tests/test_name_resolution/good/toplevel_defs.catala_en",
raise NoValueProvided(SourcePosition(filename="toplevel_defs.catala_en",
start_line=37, start_column=10,
end_line=37, end_column=11,
law_headings=["Test toplevel function defs"]))
@ -404,7 +404,7 @@ def s3(s3_in:S3In):
law_headings=[]), [], temp_a_4, temp_a_3)
except EmptyError:
temp_a_5 = dead_value
raise NoValueProvided(SourcePosition(filename="tests/test_name_resolution/good/toplevel_defs.catala_en",
raise NoValueProvided(SourcePosition(filename="toplevel_defs.catala_en",
start_line=57, start_column=10,
end_line=57, end_column=11,
law_headings=["Test function def with two args"]))
@ -422,7 +422,7 @@ def s4(s4_in:S4In):
law_headings=[]), [], temp_a_7, temp_a_6)
except EmptyError:
temp_a_8 = dead_value
raise NoValueProvided(SourcePosition(filename="tests/test_name_resolution/good/toplevel_defs.catala_en",
raise NoValueProvided(SourcePosition(filename="toplevel_defs.catala_en",
start_line=80, start_column=10,
end_line=80, end_column=11,
law_headings=["Test inline defs in toplevel defs"]))
@ -440,7 +440,7 @@ def s(s_in:SIn):
law_headings=[]), [], temp_a_10, temp_a_9)
except EmptyError:
temp_a_11 = dead_value
raise NoValueProvided(SourcePosition(filename="tests/test_name_resolution/good/toplevel_defs.catala_en",
raise NoValueProvided(SourcePosition(filename="toplevel_defs.catala_en",
start_line=7, start_column=10,
end_line=7, end_column=11,
law_headings=["Test basic toplevel values defs"]))
@ -455,7 +455,7 @@ def s(s_in:SIn):
law_headings=[]), [], temp_b_1, temp_b)
except EmptyError:
temp_b_2 = dead_value
raise NoValueProvided(SourcePosition(filename="tests/test_name_resolution/good/toplevel_defs.catala_en",
raise NoValueProvided(SourcePosition(filename="toplevel_defs.catala_en",
start_line=8, start_column=10,
end_line=8, end_column=11,
law_headings=["Test basic toplevel values defs"]))

View File

@ -13,7 +13,7 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/array_length-empty.catala_en:6.10-6.11:
┌─⯈ array_length-empty.catala_en:6.10-6.11:
└─┐
6 │ output y content boolean
│ ‾

View File

@ -14,7 +14,7 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/array_length-overlap.catala_en:6.10-6.11:
┌─⯈ array_length-overlap.catala_en:6.10-6.11:
└─┐
6 │ output y content boolean
│ ‾

View File

@ -25,7 +25,7 @@ scope Foo:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] [Foo.x] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/assert-empty.catala_en:4.11-4.12:
┌─⯈ assert-empty.catala_en:4.11-4.12:
└─┐
4 │ output x content integer
│ ‾

View File

@ -19,14 +19,14 @@ $ catala Proof --disable_counterexamples
It is impossible to give a definition to a scope variable tagged as input.
Incriminated variable:
┌─⯈ tests/test_proof/bad/dates_get_year-empty.catala_en:5.9-5.10:
┌─⯈ dates_get_year-empty.catala_en:5.9-5.10:
└─┐
5 │ input x content date
│ ‾
└─ Test
Incriminated variable definition:
┌─⯈ tests/test_proof/bad/dates_get_year-empty.catala_en:9.3-9.15:
┌─⯈ dates_get_year-empty.catala_en:9.3-9.15:
└─┐
9 │ definition x equals |2022-01-16|
│ ‾‾‾‾‾‾‾‾‾‾‾‾

View File

@ -16,7 +16,7 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/dates_get_year-overlap.catala_en:6.10-6.11:
┌─⯈ dates_get_year-overlap.catala_en:6.10-6.11:
└─┐
6 │ output y content boolean
│ ‾

View File

@ -15,7 +15,7 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/dates_simple-empty.catala_en:6.10-6.11:
┌─⯈ dates_simple-empty.catala_en:6.10-6.11:
└─┐
6 │ output y content boolean
│ ‾

View File

@ -16,7 +16,7 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/dates_simple-overlap.catala_en:6.10-6.11:
┌─⯈ dates_simple-overlap.catala_en:6.10-6.11:
└─┐
6 │ output y content boolean
│ ‾

View File

@ -13,7 +13,7 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/duration-empty.catala_en:6.10-6.11:
┌─⯈ duration-empty.catala_en:6.10-6.11:
└─┐
6 │ output y content boolean
│ ‾

View File

@ -14,7 +14,7 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/duration-overlap.catala_en:6.10-6.11:
┌─⯈ duration-overlap.catala_en:6.10-6.11:
└─┐
6 │ output y content boolean
│ ‾

View File

@ -25,13 +25,13 @@ scope A:
$ catala Proof --disable_counterexamples
[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/enums-empty.catala_en:7.7-7.8:
┌─⯈ enums-empty.catala_en:7.7-7.8:
└─┐
7 │ -- C content boolean
│ ‾
└─ Test
[WARNING] [A.x] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/enums-empty.catala_en:15.10-15.11:
┌─⯈ enums-empty.catala_en:15.10-15.11:
└──┐
15 │ output x content integer
│ ‾

View File

@ -23,13 +23,13 @@ scope A:
$ catala Proof --disable_counterexamples
[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/enums-nonbool-empty.catala_en:5.7-5.8:
┌─⯈ enums-nonbool-empty.catala_en:5.7-5.8:
└─┐
5 │ -- C content boolean
│ ‾
└─ Test
[WARNING] [A.x] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/enums-nonbool-empty.catala_en:13.10-13.11:
┌─⯈ enums-nonbool-empty.catala_en:13.10-13.11:
└──┐
13 │ output x content integer
│ ‾

View File

@ -23,13 +23,13 @@ scope A:
$ catala Proof --disable_counterexamples
[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/enums-nonbool-overlap.catala_en:5.7-5.8:
┌─⯈ enums-nonbool-overlap.catala_en:5.7-5.8:
└─┐
5 │ -- C content boolean
│ ‾
└─ Test
[WARNING] [A.x] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/enums-nonbool-overlap.catala_en:13.10-13.11:
┌─⯈ enums-nonbool-overlap.catala_en:13.10-13.11:
└──┐
13 │ output x content integer
│ ‾

View File

@ -25,13 +25,13 @@ scope A:
$ catala Proof --disable_counterexamples
[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/enums-overlap.catala_en:7.7-7.8:
┌─⯈ enums-overlap.catala_en:7.7-7.8:
└─┐
7 │ -- C content boolean
│ ‾
└─ Test
[WARNING] [A.x] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/enums-overlap.catala_en:15.10-15.11:
┌─⯈ enums-overlap.catala_en:15.10-15.11:
└──┐
15 │ output x content integer
│ ‾

View File

@ -18,13 +18,13 @@ scope A:
$ catala Proof --disable_counterexamples
[WARNING] The constructor "C2" of enumeration "E" is never used; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/enums_inj-empty.catala_en:6.6-6.8:
┌─⯈ enums_inj-empty.catala_en:6.6-6.8:
└─┐
6 │ -- C2
│ ‾‾
└─ Article
[WARNING] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/enums_inj-empty.catala_en:10.10-10.11:
┌─⯈ enums_inj-empty.catala_en:10.10-10.11:
└──┐
10 │ output y content integer
│ ‾

View File

@ -19,7 +19,7 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/enums_inj-overlap.catala_en:10.10-10.11:
┌─⯈ enums_inj-overlap.catala_en:10.10-10.11:
└──┐
10 │ output y content integer
│ ‾

View File

@ -22,7 +22,7 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/enums_unit-empty.catala_en:10.10-10.11:
┌─⯈ enums_unit-empty.catala_en:10.10-10.11:
└──┐
10 │ output y content integer
│ ‾

View File

@ -22,7 +22,7 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/enums_unit-overlap.catala_en:10.10-10.11:
┌─⯈ enums_unit-overlap.catala_en:10.10-10.11:
└──┐
10 │ output y content integer
│ ‾

View File

@ -14,7 +14,7 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] [A.x] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/let_in_condition-empty.catala_en:5.10-5.11:
┌─⯈ let_in_condition-empty.catala_en:5.10-5.11:
└─┐
5 │ output x content boolean
│ ‾

View File

@ -17,7 +17,7 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/money-empty.catala_en:8.10-8.11:
┌─⯈ money-empty.catala_en:8.10-8.11:
└─┐
8 │ output y content boolean
│ ‾

View File

@ -18,7 +18,7 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/money-overlap.catala_en:8.10-8.11:
┌─⯈ money-overlap.catala_en:8.10-8.11:
└─┐
8 │ output y content boolean
│ ‾

View File

@ -18,7 +18,7 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/no_vars-conflict.catala_en:8.10-8.11:
┌─⯈ no_vars-conflict.catala_en:8.10-8.11:
└─┐
8 │ output y content integer
│ ‾

View File

@ -17,7 +17,7 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/no_vars-empty.catala_en:7.10-7.11:
┌─⯈ no_vars-empty.catala_en:7.10-7.11:
└─┐
7 │ output y content integer
│ ‾

View File

@ -127,7 +127,7 @@ $ catala Proof --disable_counterexamples
It is impossible to give a definition to a subscope variable not tagged as input or context.
Incriminated subscope:
┌─⯈ tests/test_proof/bad/prolala_motivating_example.catala_en:56.3-56.14:
┌─⯈ prolala_motivating_example.catala_en:56.3-56.14:
└──┐
56 │ eligibility scope Eligibility
│ ‾‾‾‾‾‾‾‾‾‾‾
@ -135,7 +135,7 @@ Incriminated subscope:
└─ Amount
Incriminated variable:
┌─⯈ tests/test_proof/bad/prolala_motivating_example.catala_en:9.12-9.22:
┌─⯈ prolala_motivating_example.catala_en:9.12-9.22:
└─┐
9 │ internal is_student content boolean
│ ‾‾‾‾‾‾‾‾‾‾
@ -143,7 +143,7 @@ Incriminated variable:
└─ Eligibility
Incriminated subscope variable definition:
┌─⯈ tests/test_proof/bad/prolala_motivating_example.catala_en:64.3-64.36:
┌─⯈ prolala_motivating_example.catala_en:64.3-64.36:
└──┐
64 │ definition eligibility.is_student equals is_student
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

View File

@ -13,7 +13,7 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/rationals-empty.catala_en:6.10-6.11:
┌─⯈ rationals-empty.catala_en:6.10-6.11:
└─┐
6 │ output y content boolean
│ ‾

View File

@ -14,7 +14,7 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/rationals-overlap.catala_en:6.10-6.11:
┌─⯈ rationals-overlap.catala_en:6.10-6.11:
└─┐
6 │ output y content boolean
│ ‾

View File

@ -41,7 +41,7 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] [A.x10] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/sat_solving.catala_en:15.10-15.13:
┌─⯈ sat_solving.catala_en:15.10-15.13:
└──┐
15 │ output x10 content boolean
│ ‾‾‾

View File

@ -22,7 +22,7 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] [A.x] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/structs-empty.catala_en:13.10-13.11:
┌─⯈ structs-empty.catala_en:13.10-13.11:
└──┐
13 │ output x content integer
│ ‾

View File

@ -22,7 +22,7 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] [A.x] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/structs-overlap.catala_en:13.10-13.11:
┌─⯈ structs-overlap.catala_en:13.10-13.11:
└──┐
13 │ output x content integer
│ ‾

View File

@ -23,7 +23,7 @@ scope A:
$ catala Proof --disable_counterexamples
[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary?
┌─⯈ tests/test_proof/good/enums-arith.catala_en:5.7-5.8:
┌─⯈ enums-arith.catala_en:5.7-5.8:
└─┐
5 │ -- C content boolean
│ ‾

View File

@ -23,7 +23,7 @@ scope A:
$ 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:
┌─⯈ enums-nonbool.catala_en:5.7-5.8:
└─┐
5 │ -- C content boolean
│ ‾

View File

@ -22,7 +22,7 @@ scope A:
$ catala Proof --disable_counterexamples
[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary?
┌─⯈ tests/test_proof/good/enums.catala_en:5.7-5.8:
┌─⯈ enums.catala_en:5.7-5.8:
└─┐
5 │ -- C content boolean
│ ‾

View File

@ -21,21 +21,21 @@ Cyclic dependency detected between the following variables of scope A:
z → x → y → z
z is used here in the definition of x:
┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:14.23-14.24:
┌─⯈ cycle_in_scope.catala_en:14.23-14.24:
└──┐
14 │ definition x equals z
│ ‾
└─ Article
x is used here in the definition of y:
┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:11.32-11.33:
┌─⯈ cycle_in_scope.catala_en:11.32-11.33:
└──┐
11 │ definition y under condition x >= 0 consequence equals x
│ ‾
└─ Article
y is used here in the definition of z:
┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:13.32-13.33:
┌─⯈ cycle_in_scope.catala_en:13.32-13.33:
└──┐
13 │ definition z under condition y < 1 consequence equals y
│ ‾

View File

@ -33,19 +33,19 @@ Cyclic dependency detected between the following scopes:
S4 → S3 → S2 → S4
S4 is used here in the definition of S3:
┌─⯈ tests/test_scope/bad/cyclic_scope_calls.catala_en:21.24-21.36:
┌─⯈ cyclic_scope_calls.catala_en:21.24-21.36:
└──┐
21 │ definition o equals (output of S4).o
│ ‾‾‾‾‾‾‾‾‾‾‾‾
S3 is used here in the definition of S2:
┌─⯈ tests/test_scope/bad/cyclic_scope_calls.catala_en:18.43-18.55:
┌─⯈ cyclic_scope_calls.catala_en:18.43-18.55:
└──┐
18 │ definition o equals (output of S1).o + (output of S3).o
│ ‾‾‾‾‾‾‾‾‾‾‾‾
S2 is used here in the definition of S4:
┌─⯈ tests/test_scope/bad/cyclic_scope_calls.catala_en:24.24-24.36:
┌─⯈ cyclic_scope_calls.catala_en:24.24-24.36:
└──┐
24 │ definition o equals (output of S2).o
│ ‾‾‾‾‾‾‾‾‾‾‾‾

View File

@ -22,14 +22,14 @@ $ catala Interpret -s A
Cyclic dependency detected between the following scopes: B → A → B
B is used here in the definition of A:
┌─⯈ tests/test_scope/bad/cyclic_scopes.catala_en:5.3-5.4:
┌─⯈ cyclic_scopes.catala_en:5.3-5.4:
└─┐
5 │ b scope B
│ ‾
└─ Article
A is used here in the definition of B:
┌─⯈ tests/test_scope/bad/cyclic_scopes.catala_en:9.3-9.4:
┌─⯈ cyclic_scopes.catala_en:9.3-9.4:
└─┐
9 │ a scope A
│ ‾

View File

@ -20,14 +20,14 @@ $ catala Interpret -s A
There is a conflict between multiple valid consequences for assigning the same variable.
This consequence has a valid justification:
┌─⯈ tests/test_scope/bad/scope.catala_en:13.57-13.61:
┌─⯈ scope.catala_en:13.57-13.61:
└──┐
13 │ definition b under condition not c consequence equals 1337
│ ‾‾‾‾
└─ Article
This consequence has a valid justification:
┌─⯈ tests/test_scope/bad/scope.catala_en:14.57-14.58:
┌─⯈ scope.catala_en:14.57-14.58:
└──┐
14 │ definition b under condition not c consequence equals 0
│ ‾

View File

@ -19,7 +19,7 @@ $ catala dcalc -s Titi
[ERROR]
Duplicate definition of scope input variable 'bar'
┌─⯈ tests/test_scope/bad/scope_call_duplicate.catala_en:14.70-14.73:
┌─⯈ scope_call_duplicate.catala_en:14.70-14.73:
└──┐
14 │ definition fizz equals output of Toto with {--bar: 1 --baz: 2.1 -- bar: 3}
│ ‾‾‾

View File

@ -19,13 +19,13 @@ $ catala dcalc -s Titi
[ERROR]
Scope Toto has no input variable biz
┌─⯈ tests/test_scope/bad/scope_call_extra.catala_en:14.49-14.52:
┌─⯈ scope_call_extra.catala_en:14.49-14.52:
└──┐
14 │ definition fizz equals output of Toto with {--biz: 1}
│ ‾‾‾
Scope Toto declared here
┌─⯈ tests/test_scope/bad/scope_call_extra.catala_en:2.19-2.23:
┌─⯈ scope_call_extra.catala_en:2.19-2.23:
└─┐
2 │ declaration scope Toto:
│ ‾‾‾‾

View File

@ -19,13 +19,13 @@ $ catala dcalc -s Titi
[ERROR]
Definition of input variable 'baz' missing in this scope call
┌─⯈ tests/test_scope/bad/scope_call_missing.catala_en:14.26-14.56:
┌─⯈ scope_call_missing.catala_en:14.26-14.56:
└──┐
14 │ definition fizz equals output of Toto with {--bar: 1}
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Declaration of the missing input variable
┌─⯈ tests/test_scope/bad/scope_call_missing.catala_en:4.16-4.19:
┌─⯈ scope_call_missing.catala_en:4.16-4.19:
└─┐
4 │ input output baz content decimal
│ ‾‾‾

View File

@ -18,7 +18,7 @@ $ catala Interpret -s A
[ERROR]
The subscope a is used when defining one of its inputs, but recursion is forbidden in Catala
┌─⯈ tests/test_scope/bad/sub_vars_in_sub_var.catala_en:13.28-13.31:
┌─⯈ sub_vars_in_sub_var.catala_en:13.28-13.31:
└──┐
13 │ definition a.y equals if a.x then 0 else 1
│ ‾‾‾

View File

@ -46,9 +46,8 @@ end
let scope_a (scope_a_in: ScopeAIn.t) : ScopeA.t =
let a_: bool = try true with
EmptyError -> (raise (NoValueProvided
{filename = "tests/test_scope/good/191_fix_record_name_confusion.catala_en";
start_line=5; start_column=10; end_line=5; end_column=11;
law_headings=["Article"]})) in
{filename = "191_fix_record_name_confusion.catala_en"; start_line=5;
start_column=10; end_line=5; end_column=11; law_headings=["Article"]})) in
{ScopeA.a = a_}
let scope_b (scope_b_in: ScopeBIn.t) : ScopeB.t =
@ -56,9 +55,8 @@ let scope_b (scope_b_in: ScopeBIn.t) : ScopeB.t =
let scope_a_dot_a_: bool = result_.ScopeA.a in
let a_: bool = try scope_a_dot_a_ with
EmptyError -> (raise (NoValueProvided
{filename = "tests/test_scope/good/191_fix_record_name_confusion.catala_en";
start_line=8; start_column=10; end_line=8; end_column=11;
law_headings=["Article"]})) in
{filename = "191_fix_record_name_confusion.catala_en"; start_line=8;
start_column=10; end_line=8; end_column=11; law_headings=["Article"]})) in
{ScopeB.a = a_}
let () =
Runtime_ocaml.Runtime.register_module "191_fix_record_name_confusion"

View File

@ -9,7 +9,7 @@ declaration scope Foo2:
$ catala Scalc -s Foo2 -O -t
[WARNING] In scope "Foo2", the variable "bar" is declared but never defined; did you forget something?
┌─⯈ tests/test_scope/good/nothing.catala_en:5.10-5.13:
┌─⯈ nothing.catala_en:5.10-5.13:
└─┐
5 │ output bar content integer
│ ‾‾‾

View File

@ -20,7 +20,7 @@ scope RentComputation:
$ catala Interpret -t -s HousingComputation --debug
[DEBUG] Collecting rules...
[DEBUG] Reading files...
[DEBUG] Parsing tests/test_scope/good/scope_call3.catala_en
[DEBUG] Parsing scope_call3.catala_en
[DEBUG] Name resolution...
[DEBUG] Desugaring...
[DEBUG] Disambiguating...
@ -31,14 +31,14 @@ $ catala Interpret -t -s HousingComputation --debug
[DEBUG] Starting interpretation...
[LOG] ≔ HousingComputation.f: <function>
[LOG] ☛ Definition applied:
┌─⯈ tests/test_scope/good/scope_call3.catala_en:8.14-8.20:
┌─⯈ scope_call3.catala_en:8.14-8.20:
└─┐
8 │ definition result equals f of 1
│ ‾‾‾‾‾‾
[LOG] → HousingComputation.f
[LOG] ≔ HousingComputation.f.input0: 1
[LOG] ☛ Definition applied:
┌─⯈ tests/test_scope/good/scope_call3.catala_en:7.14-7.15:
┌─⯈ scope_call3.catala_en:7.14-7.15:
└─┐
7 │ definition f of x equals (output of RentComputation).f of x
│ ‾
@ -47,7 +47,7 @@ $ catala Interpret -t -s HousingComputation --debug
[LOG] ≔ RentComputation.g: <function>
[LOG] ≔ RentComputation.f: <function>
[LOG] ☛ Definition applied:
┌─⯈ tests/test_scope/good/scope_call3.catala_en:7.29-7.54:
┌─⯈ scope_call3.catala_en:7.29-7.54:
└─┐
7 │ definition f of x equals (output of RentComputation).f of x
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
@ -56,14 +56,14 @@ $ catala Interpret -t -s HousingComputation --debug
[LOG] → RentComputation.f
[LOG] ≔ RentComputation.f.input0: 1
[LOG] ☛ Definition applied:
┌─⯈ tests/test_scope/good/scope_call3.catala_en:16.14-16.15:
┌─⯈ scope_call3.catala_en:16.14-16.15:
└──┐
16 │ definition f of x equals g of (x + 1)
│ ‾
[LOG] → RentComputation.g
[LOG] ≔ RentComputation.g.input0: 2
[LOG] ☛ Definition applied:
┌─⯈ tests/test_scope/good/scope_call3.catala_en:15.14-15.15:
┌─⯈ scope_call3.catala_en:15.14-15.15:
└──┐
15 │ definition g of x equals x + 1
│ ‾

View File

@ -26,7 +26,7 @@ scope RentComputation:
$ catala Interpret -s RentComputation --debug
[DEBUG] Collecting rules...
[DEBUG] Reading files...
[DEBUG] Parsing tests/test_scope/good/scope_call4.catala_en
[DEBUG] Parsing scope_call4.catala_en
[DEBUG] Name resolution...
[DEBUG] Desugaring...
[DEBUG] Disambiguating...
@ -51,7 +51,7 @@ f2 = λ (x: integer) →
$ catala Interpret_Lcalc -s RentComputation --avoid_exceptions --optimize --debug
[DEBUG] Collecting rules...
[DEBUG] Reading files...
[DEBUG] Parsing tests/test_scope/good/scope_call4.catala_en
[DEBUG] Parsing scope_call4.catala_en
[DEBUG] Name resolution...
[DEBUG] Desugaring...
[DEBUG] Disambiguating...

View File

@ -22,14 +22,14 @@ $ catala Interpret -s A
struct name "S" already defined
First definition:
┌─⯈ tests/test_struct/bad/bug_107.catala_en:4.23-4.24:
┌─⯈ bug_107.catala_en:4.23-4.24:
└─┐
4 │ declaration structure S:
│ ‾
└─ https://github.com/CatalaLang/catala/issues/107
Second definition:
┌─⯈ tests/test_struct/bad/bug_107.catala_en:8.23-8.24:
┌─⯈ bug_107.catala_en:8.23-8.24:
└─┐
8 │ declaration structure S:
│ ‾

View File

@ -12,7 +12,7 @@ $ catala Typecheck
[ERROR]
The struct Foo does not have any fields; give it some for Catala to be able to accept it.
┌─⯈ tests/test_struct/bad/empty_struct.catala_en:4.23-4.26:
┌─⯈ empty_struct.catala_en:4.23-4.26:
└─┐
4 │ declaration structure Foo:
│ ‾‾‾

View File

@ -16,7 +16,7 @@ scope A:
$ catala Interpret -s A
[WARNING] The constructor "Rec" of enumeration "E" is never used; maybe it's unnecessary?
┌─⯈ tests/test_struct/bad/nested.catala_en:6.6-6.9:
┌─⯈ nested.catala_en:6.6-6.9:
└─┐
6 │ -- Rec content E
│ ‾‾‾
@ -24,7 +24,7 @@ $ catala Interpret -s A
[ERROR]
The type E is defined using itself, which is forbidden since Catala does not provide recursive types
┌─⯈ tests/test_struct/bad/nested.catala_en:6.18-6.19:
┌─⯈ nested.catala_en:6.18-6.19:
└─┐
6 │ -- Rec content E
│ ‾

View File

@ -17,21 +17,21 @@ declaration scope A:
$ catala Interpret -s A
[WARNING] In scope "A", the variable "x" is declared but never defined; did you forget something?
┌─⯈ tests/test_struct/bad/nested2.catala_en:13.10-13.11:
┌─⯈ nested2.catala_en:13.10-13.11:
└──┐
13 │ output x content E
│ ‾
└─ Article
[WARNING] The structure "S" is never used; maybe it's unnecessary?
┌─⯈ tests/test_struct/bad/nested2.catala_en:4.23-4.24:
┌─⯈ nested2.catala_en:4.23-4.24:
└─┐
4 │ declaration structure S:
│ ‾
└─ Article
[WARNING] The enumeration "E" is never used; maybe it's unnecessary?
┌─⯈ tests/test_struct/bad/nested2.catala_en:8.25-8.26:
┌─⯈ nested2.catala_en:8.25-8.26:
└─┐
8 │ declaration enumeration E:
│ ‾
@ -40,28 +40,28 @@ $ catala Interpret -s A
Cyclic dependency detected between types!
Cycle type S, declared:
┌─⯈ tests/test_struct/bad/nested2.catala_en:4.23-4.24:
┌─⯈ nested2.catala_en:4.23-4.24:
└─┐
4 │ declaration structure S:
│ ‾
└─ Article
Used here in the definition of another cycle type E:
┌─⯈ tests/test_struct/bad/nested2.catala_en:10.20-10.21:
┌─⯈ nested2.catala_en:10.20-10.21:
└──┐
10 │ -- Case2 content S
│ ‾
└─ Article
Cycle type E, declared:
┌─⯈ tests/test_struct/bad/nested2.catala_en:8.25-8.26:
┌─⯈ nested2.catala_en:8.25-8.26:
└─┐
8 │ declaration enumeration E:
│ ‾
└─ Article
Used here in the definition of another cycle type S:
┌─⯈ tests/test_struct/bad/nested2.catala_en:5.18-5.19:
┌─⯈ nested2.catala_en:5.18-5.19:
└─┐
5 │ data x content E
│ ‾

View File

@ -18,7 +18,7 @@ $ catala Interpret -s A
[ERROR]
No struct named Fo found
┌─⯈ tests/test_struct/bad/nonexisting_struct.catala_en:13.25-13.27:
┌─⯈ nonexisting_struct.catala_en:13.25-13.27:
└──┐
13 │ definition y equals x.Fo.f
│ ‾‾

View File

@ -22,7 +22,7 @@ $ catala Interpret -s A
[ERROR]
Field "g" does not belong to structure "Foo", but to "Bar"
┌─⯈ tests/test_struct/bad/wrong_qualified_field.catala_en:17.23-17.30:
┌─⯈ wrong_qualified_field.catala_en:17.23-17.30:
└──┐
17 │ definition y equals x.Foo.g
│ ‾‾‾‾‾‾‾

View File

@ -20,7 +20,7 @@ scope A:
$ catala Interpret -s A
[WARNING] The structure "Bar" is never used; maybe it's unnecessary?
┌─⯈ tests/test_struct/good/ambiguous_fields.catala_en:7.23-7.26:
┌─⯈ ambiguous_fields.catala_en:7.23-7.26:
└─┐
7 │ declaration structure Bar:
│ ‾‾‾
@ -32,7 +32,7 @@ $ catala Interpret -s A
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
[WARNING] The structure "Bar" is never used; maybe it's unnecessary?
┌─⯈ tests/test_struct/good/ambiguous_fields.catala_en:7.23-7.26:
┌─⯈ ambiguous_fields.catala_en:7.23-7.26:
└─┐
7 │ declaration structure Bar:
│ ‾‾‾

Some files were not shown because too many files have changed in this diff Show More