diff --git a/compiler/catala_utils/message.ml b/compiler/catala_utils/message.ml index 3d3ab5d92..154d1a22a 100644 --- a/compiler/catala_utils/message.ml +++ b/compiler/catala_utils/message.ml @@ -115,11 +115,11 @@ let pp_marker target ppf = let open Ocolor_types in let tags, str = match target with - | Debug -> [Bold; Fg (C4 magenta)], "[DEBUG]" - | Error -> [Bold; Fg (C4 red)], "[ERROR]" - | Warning -> [Bold; Fg (C4 yellow)], "[WARNING]" - | Result -> [Bold; Fg (C4 green)], "[RESULT]" - | Log -> [Bold; Fg (C4 black)], "[LOG]" + | Debug -> [Bold; Fg (C4 magenta)], "DEBUG" + | Error -> [Bold; Fg (C4 red)], "ERROR" + | Warning -> [Bold; Fg (C4 yellow)], "WARNING" + | Result -> [Bold; Fg (C4 green)], "RESULT" + | Log -> [Bold; Fg (C4 black)], "LOG" in if target = Debug then print_time_marker ppf (); Format.pp_open_stag ppf (Ocolor_format.Ocolor_styles_tag tags); @@ -164,28 +164,117 @@ module Content = struct let of_string (s : string) : t = [MainMessage (fun ppf -> Format.pp_print_text ppf s)] + let basic_msg ppf target content = + Format.pp_open_vbox ppf 0; + Format.pp_print_list + ~pp_sep:(fun ppf () -> Format.fprintf ppf "@,@,") + (fun ppf -> function + | Position pos -> + Option.iter + (fun msg -> Format.fprintf ppf "@[%t@]@," msg) + pos.pos_message; + Pos.format_loc_text ppf pos.pos + | MainMessage msg -> + Format.fprintf ppf "@[[%t] %t@]" (pp_marker target) msg + | Outcome msg -> + Format.fprintf ppf "@[[%t]@ %t@]" (pp_marker target) msg + | Suggestion suggestions_list -> Suggestions.format ppf suggestions_list) + ppf content; + Format.pp_close_box ppf (); + Format.pp_print_newline ppf () + + let fancy_msg ppf target content = + let ppf_out_fcts = Format.pp_get_formatter_out_functions ppf () in + let restore_ppf () = + Format.pp_print_flush ppf (); + Format.pp_set_formatter_out_functions ppf ppf_out_fcts + in + let getcolorstr pp = + let buf = Buffer.create 17 in + let ppfb = Format.formatter_of_buffer buf in + Format.pp_set_formatter_stag_functions ppfb + (Format.pp_get_formatter_stag_functions ppf ()); + Format.pp_set_mark_tags ppfb (Format.pp_get_mark_tags ppf ()); + pp ppfb; + Format.pp_print_flush ppfb (); + Buffer.contents buf + in + (* The following adds a blue line on the left *) + Format.pp_set_formatter_out_functions ppf + { + ppf_out_fcts with + out_indent = + (fun n -> + let lead = + getcolorstr (fun ppf -> Format.fprintf ppf "@{@<1>%s@}" "│") + in + if n >= 1 then ppf_out_fcts.out_string lead 0 (String.length lead); + if n >= 2 then ppf_out_fcts.out_indent (n - 1)); + }; + Format.pp_open_vbox ppf 1; + Format.fprintf ppf "@{@<2>%s[%t]@<2>%s@}" "┌─" (pp_marker target) "─"; + (* Returns true when a finaliser is needed *) + let print_elt ppf ?(islast = false) = function + | MainMessage msg -> + Format.fprintf ppf "@,@[@,@[%t@]@]" msg; + if islast then Format.pp_print_cut ppf (); + true + | Position pos -> ( + Format.pp_print_cut ppf (); + Option.iter + (fun msg -> Format.fprintf ppf "@[@,@[%t@]@]" msg) + pos.pos_message; + Format.pp_print_break ppf 0 (-1); + let pr_head, pr_context, pr_legal = Pos.format_loc_text_parts pos.pos in + Format.pp_open_vbox ppf 2; + Format.fprintf ppf "@{@<1>%s@}%t" "├" pr_head; + pr_context ppf; + Format.pp_close_box ppf (); + match pr_legal with + | None -> true + | Some pr_legal -> + Format.pp_print_break ppf 0 (-1); + if islast then ( + restore_ppf (); + Format.pp_open_vbox ppf 3; + Format.fprintf ppf "@{@<3>%s@}%t" "└─ " pr_legal) + else ( + Format.pp_open_vbox ppf 3; + Format.fprintf ppf "@{@<3>%s@}%t" "├─ " pr_legal); + Format.pp_close_box ppf (); + not islast) + | Outcome msg -> + Format.fprintf ppf "@;<0 1>@[@[%t@]@]" msg; + true + | Suggestion suggestions_list -> + Format.fprintf ppf "@,@[@,@[%a@]@]" Suggestions.format + suggestions_list; + true + in + let rec print_lines ppf = function + | [elt] -> + let finalise = print_elt ppf ~islast:true elt in + Format.pp_close_box ppf (); + if finalise then Format.fprintf ppf "@,@{@<2>%s@}" "└─" + | elt :: r -> + let _ = print_elt ppf elt in + print_lines ppf r + | [] -> + Format.pp_close_box ppf (); + Format.pp_print_cut ppf () + in + print_lines ppf content; + Format.pp_close_box ppf (); + restore_ppf (); + Format.pp_print_newline ppf () + let emit (content : t) (target : level) : unit = match Global.options.message_format with - | Global.Human -> + | Global.Human -> ( let ppf = get_ppf target in - Format.pp_open_vbox ppf 0; - Format.pp_print_list - ~pp_sep:(fun ppf () -> Format.fprintf ppf "@,@,") - (fun ppf -> function - | Position pos -> - Option.iter - (fun msg -> Format.fprintf ppf "@[%t@]@," msg) - pos.pos_message; - Pos.format_loc_text ppf pos.pos - | MainMessage msg -> - Format.fprintf ppf "@[%t %t@]" (pp_marker target) msg - | Outcome msg -> - Format.fprintf ppf "@[%t@ %t@]" (pp_marker target) msg - | Suggestion suggestions_list -> - Suggestions.format ppf suggestions_list) - ppf content; - Format.pp_close_box ppf (); - Format.pp_print_newline ppf () + match target with + | Debug | Log -> basic_msg ppf target content + | Result | Warning | Error -> fancy_msg ppf target content) | Global.GNU -> (* The top message doesn't come with a position, which is not something the GNU standard allows. So we look the position list and put the top @@ -222,7 +311,7 @@ module Content = struct (fun pos -> Format.fprintf ppf "@{%s@}: " (Pos.to_string_short pos)) pos; - pp_marker target ppf; + Format.fprintf ppf "[%t]" (pp_marker target); match message with | Some message -> Format.pp_print_char ppf ' '; @@ -247,6 +336,7 @@ type ('a, 'b) emitter = ?pos_msg:Content.message -> ?extra_pos:(string * Pos.t) list -> ?fmt_pos:(Content.message * Pos.t) list -> + ?outcome:Content.message list -> ?suggestion:string list -> ('a, Format.formatter, unit, 'b) format4 -> 'a @@ -258,47 +348,58 @@ let make ?pos_msg ?extra_pos ?fmt_pos + ?(outcome = []) ?(suggestion = []) ~cont ~level = - Format.kdprintf - @@ fun message -> - let t = - match level with Result -> of_result message | _ -> of_message message - in - let t = match header with Some h -> prepend_message t h | None -> t in - let t = if internal then to_internal_error t else t in - let t = - match pos with Some p -> add_position t ?message:pos_msg p | None -> t - in - let t = - match extra_pos with - | Some pl -> - List.fold_left - (fun t (message, p) -> - let message = - if message = "" then None - else Some (fun ppf -> Format.pp_print_text ppf message) - in - add_position t ?message p) - t pl - | None -> t - in - let t = - match fmt_pos with - | Some pl -> - List.fold_left - (fun t (message, p) -> - let message = if message == ignore then None else Some message in - add_position t ?message p) - t pl - | None -> t - in - let t = match suggestion with [] -> t | s -> add_suggestion t s in - cont t level + match level with + | Debug when not Global.options.debug -> + Format.ikfprintf (fun _ -> cont [] level) (Lazy.force ignore_ppf) + | Warning when Global.options.disable_warnings -> + Format.ikfprintf (fun _ -> cont [] level) (Lazy.force ignore_ppf) + | _ -> + Format.kdprintf + @@ fun message -> + let t = + match level with Result -> of_result message | _ -> of_message message + in + let t = match header with Some h -> prepend_message t h | None -> t in + let t = if internal then to_internal_error t else t in + let t = + match outcome with [] -> t | o -> t @ List.map (fun o -> Outcome o) o + in + let t = + match pos with Some p -> add_position t ?message:pos_msg p | None -> t + in + let t = + match extra_pos with + | Some pl -> + List.fold_left + (fun t (message, p) -> + let message = + if message = "" then None + else Some (fun ppf -> Format.pp_print_text ppf message) + in + add_position t ?message p) + t pl + | None -> t + in + let t = + match fmt_pos with + | Some pl -> + List.fold_left + (fun t (message, p) -> + let message = if message == ignore then None else Some message in + add_position t ?message p) + t pl + | None -> t + in + let t = match suggestion with [] -> t | s -> add_suggestion t s in + cont t level let debug = make ~level:Debug ~cont:emit let log = make ~level:Log ~cont:emit let result = make ~level:Result ~cont:emit +let results r = emit (List.flatten (List.map of_result r)) Result let warning = make ~level:Warning ~cont:emit let error = make ~level:Error ~cont:(fun m _ -> raise (CompilerError m)) diff --git a/compiler/catala_utils/message.mli b/compiler/catala_utils/message.mli index 1ef32a729..3e97c9a8b 100644 --- a/compiler/catala_utils/message.mli +++ b/compiler/catala_utils/message.mli @@ -89,6 +89,7 @@ type ('a, 'b) emitter = ?pos_msg:Content.message -> ?extra_pos:(string * Pos.t) list -> ?fmt_pos:(Content.message * Pos.t) list -> + ?outcome:Content.message list -> ?suggestion:string list -> ('a, Format.formatter, unit, 'b) format4 -> 'a @@ -98,3 +99,4 @@ val debug : ('a, unit) emitter val result : ('a, unit) emitter val warning : ('a, unit) emitter val error : ('a, 'b) emitter +val results : Content.message list -> unit diff --git a/compiler/catala_utils/pos.ml b/compiler/catala_utils/pos.ml index c283f206f..ea150e0bd 100644 --- a/compiler/catala_utils/pos.ml +++ b/compiler/catala_utils/pos.ml @@ -121,102 +121,136 @@ let utf8_byte_index s ui0 = in aux 0 0 -let format_loc_text ppf (pos : t) = - try - let filename = get_file pos in - if filename = "" then Format.pp_print_string ppf "No position information" - else - let sline = get_start_line pos in - let eline = get_end_line pos in - let ic, input_line_opt = - let from_contents = - match Global.options.input_src with - | Contents (str, _) when str = filename -> Some str - | _ -> None - in - match from_contents with - | Some str -> - let line_index = ref 0 in - let lines = String.split_on_char '\n' str in - let input_line_opt () : string option = - match List.nth_opt lines !line_index with - | Some l -> - line_index := !line_index + 1; - Some l - | None -> None +let format_loc_text_parts (pos : t) = + let filename = get_file pos in + if filename = "" then + ( (fun ppf -> Format.pp_print_string ppf "No position information"), + ignore, + None ) + else + let pr_head ppf = + Format.fprintf ppf "@{─➤ @{%s:@}@}@," (to_string_short pos) + in + let pr_context, pr_legal = + try + let sline = get_start_line pos in + let eline = get_end_line pos in + let ic, input_line_opt = + let from_contents = + match Global.options.input_src with + | Contents (str, _) when str = filename -> Some str + | _ -> None in - None, input_line_opt - | None -> ( - try - let ic = open_in filename in + match from_contents with + | Some str -> + let line_index = ref 0 in + let lines = String.split_on_char '\n' str in let input_line_opt () : string option = - try Some (input_line ic) with End_of_file -> None + match List.nth_opt lines !line_index with + | Some l -> + line_index := !line_index + 1; + Some l + | None -> None in - Some ic, input_line_opt - with Sys_error _ -> None, fun () -> None) - in - let include_extra_count = 0 in - let rec get_lines (n : int) : (int * string) list = - match input_line_opt () with - | Some line -> - if n < sline - include_extra_count then get_lines (n + 1) - else if - n >= sline - include_extra_count && n <= eline + include_extra_count - then (n, line) :: get_lines (n + 1) - else [] - | None -> [] - in - let pos_lines = get_lines 1 in - let nspaces = int_of_float (log10 (float_of_int eline)) + 1 in - let legal_pos_lines = - List.rev_map - (fun s -> - Re.Pcre.substitute ~rex:(Re.Pcre.regexp "\n\\s*") - ~subst:(fun _ -> " ") - s) - pos.law_pos - in - (match ic with None -> () | Some ic -> close_in ic); - let print_matched_line ppf ((line_no, line) : int * string) = - let line_indent = indent_number line in - let match_start_index = - utf8_byte_index line - (if line_no = sline then get_start_column pos - 1 else line_indent) + None, input_line_opt + | None -> ( + try + let ic = open_in filename in + let input_line_opt () : string option = + try Some (input_line ic) with End_of_file -> None + in + Some ic, input_line_opt + with Sys_error _ -> None, fun () -> None) in - let match_end_index = - if line_no = eline then utf8_byte_index line (get_end_column pos - 1) - else String.length line + let include_extra_count = 0 in + let rec get_lines (n : int) : (int * string) list = + match input_line_opt () with + | Some line -> + if n < sline - include_extra_count then get_lines (n + 1) + else if + n >= sline - include_extra_count + && n <= eline + include_extra_count + then (n, line) :: get_lines (n + 1) + else [] + | None -> [] in - let unmatched_prefix = String.sub line 0 match_start_index in - let matched_substring = - String.sub line match_start_index - (max 0 (match_end_index - match_start_index)) + let pos_lines = get_lines 1 in + let nspaces = int_of_float (log10 (float_of_int eline)) + 1 in + (match ic with None -> () | Some ic -> close_in ic); + let print_matched_line ppf ((line_no, line) : int * string) = + let line_indent = indent_number line in + let match_start_index = + utf8_byte_index line + (if line_no = sline then get_start_column pos - 1 else line_indent) + in + let match_end_index = + if line_no = eline then utf8_byte_index line (get_end_column pos - 1) + else String.length line + in + let unmatched_prefix = String.sub line 0 match_start_index in + let matched_substring = + String.sub line match_start_index + (max 0 (match_end_index - match_start_index)) + in + let match_start_col = String.width unmatched_prefix in + let match_num_cols = String.width matched_substring in + Format.fprintf ppf "@{%*d │@} %a" nspaces line_no + (fun ppf -> Format.pp_print_as ppf (String.width line)) + line; + Format.pp_print_cut ppf (); + if line_no >= sline && line_no <= eline then + Format.fprintf ppf "@{%s │@} %s@{%a@}" + (string_repeat nspaces " ") + (string_repeat match_start_col " ") + (fun ppf -> Format.pp_print_as ppf match_num_cols) + (string_repeat match_num_cols "‾") in - let match_start_col = String.width unmatched_prefix in - let match_num_cols = String.width matched_substring in - Format.fprintf ppf "@{%*d │@} %s@," nspaces line_no line; - if line_no >= sline && line_no <= eline then - Format.fprintf ppf "@{%s │@} %s@{%s@}" - (string_repeat nspaces " ") - (string_repeat match_start_col " ") - (string_repeat match_num_cols "‾") - in - Format.pp_open_vbox ppf 0; - Format.fprintf ppf "@{┌─⯈ %s:@}@," (to_string_short pos); - Format.fprintf ppf "@{└%s┐@}@," (string_repeat nspaces "─"); - Format.pp_print_list print_matched_line ppf pos_lines; - (* Format.pp_print_cut ppf (); *) - let rec pp_legal nspaces = function - | [last] -> - Format.fprintf ppf "@,@{%*s└─ %s@}" nspaces "" last - | l :: lines -> - Format.fprintf ppf "@,@{%*s└┬ %s@}" nspaces "" l; - pp_legal (nspaces + 1) lines - | [] -> () - in - pp_legal (nspaces + 1) legal_pos_lines; - Format.pp_close_box ppf () - with Sys_error _ -> Format.fprintf ppf "Location: %s" (to_string pos) + let pr_context ppf = + Format.fprintf ppf "@{ %s│@}@," (string_repeat nspaces " "); + Format.pp_print_list print_matched_line ppf pos_lines + in + let legal_pos_lines = + List.rev_map + (fun s -> + Re.Pcre.substitute ~rex:(Re.Pcre.regexp "\n\\s*") + ~subst:(fun _ -> " ") + s) + pos.law_pos + in + let rec pp_legal nspaces leg ppf = + match leg with + | [last] -> + Format.fprintf ppf "@,@{%*s@<2>%s %s@}" nspaces "" "└─" last + | l :: lines -> + Format.fprintf ppf "@,@{%*s@<2>%s %s@}" nspaces "" "└┬" l; + pp_legal (nspaces + 1) lines ppf + | [] -> () + in + let pr_law = + match legal_pos_lines with + | [] -> None + | fst :: rest -> + Some + (fun ppf -> + Format.fprintf ppf "@{%s@}" fst; + pp_legal 0 rest ppf) + in + pr_context, pr_law + with Sys_error _ -> ignore, None + in + pr_head, pr_context, pr_legal + +let format_loc_text ppf t = + let pr_head, pr_context, pr_legal = format_loc_text_parts t in + Format.pp_open_vbox ppf 0; + pr_head ppf; + pr_context ppf; + Option.iter + (fun f -> + Format.pp_print_cut ppf (); + f ppf) + pr_legal; + Format.pp_close_box ppf () let no_pos : t = let zero_pos = diff --git a/compiler/catala_utils/pos.mli b/compiler/catala_utils/pos.mli index ac8181d47..a6019e7b4 100644 --- a/compiler/catala_utils/pos.mli +++ b/compiler/catala_utils/pos.mli @@ -59,5 +59,13 @@ val format_loc_text : Format.formatter -> t -> unit (** Open the file corresponding to the position and retrieves the text concerned by the position *) +val format_loc_text_parts : + t -> + (Format.formatter -> unit) + * (Format.formatter -> unit) + * (Format.formatter -> unit) option +(** Like [format_loc_text], but returns the printing functions in 3 separate + parts: the file name header, the line context, and the law headers *) + val no_pos : t (** Placeholder position *) diff --git a/compiler/catala_utils/suggestions.ml b/compiler/catala_utils/suggestions.ml index 0428e7b1a..0b2551e03 100644 --- a/compiler/catala_utils/suggestions.ml +++ b/compiler/catala_utils/suggestions.ml @@ -102,4 +102,5 @@ let format (ppf : Format.formatter) (suggestions_list : string list) = Format.pp_print_list ~pp_sep:(fun ppf () -> Format.fprintf ppf ",@ or ") (fun ppf string -> Format.fprintf ppf "@{\"%s\"@}" string) - ppf suggestions_list + ppf suggestions_list; + Format.pp_print_string ppf " ?" diff --git a/compiler/desugared/print.ml b/compiler/desugared/print.ml index 50902d9f7..483e7e03b 100644 --- a/compiler/desugared/print.ml +++ b/compiler/desugared/print.ml @@ -92,10 +92,12 @@ let print_exceptions_graph Ast.ScopeDef.format var ScopeName.format scope; Dependency.ExceptionsDependencies.iter_vertex (fun ex -> - Message.result "@[Definitions with label \"%a\":@,%a@]" - LabelName.format ex.Dependency.ExceptionVertex.label - (RuleName.Map.format_values Pos.format_loc_text) - ex.Dependency.ExceptionVertex.rules) + Message.result "Definitions with label@ \"%a\":" LabelName.format + ex.Dependency.ExceptionVertex.label + ~extra_pos: + (List.map + (fun p -> "", p) + (RuleName.Map.values ex.Dependency.ExceptionVertex.rules))) g; let tree = build_exception_tree g in Message.result "@[The exception tree structure is as follows:@,@,%a@]" diff --git a/compiler/driver.ml b/compiler/driver.ml index f045f8f66..adfc07eed 100644 --- a/compiler/driver.ml +++ b/compiler/driver.ml @@ -688,18 +688,19 @@ module Commands = struct let results = List.sort (fun ((v1, _), _) ((v2, _), _) -> String.compare v1 v2) results in - Message.result "Computation successful!%s" - (if List.length results > 0 then " Results:" else ""); let language = Cli.file_lang (Global.input_src_file options.Global.input_src) in - List.iter - (fun ((var, _), result) -> - Message.result "@[%s@ =@ %a@]" var - (if options.Global.debug then Print.expr ~debug:false () - else Print.UserFacing.value language) - result) - results + if results = [] then Message.result "Computation successful!" + else + Message.results + (List.map + (fun ((var, _), result) ppf -> + Format.fprintf ppf "@[%s@ =@ %a@]" var + (if options.Global.debug then Print.expr ~debug:false () + else Print.UserFacing.value language) + result) + results) let interpret_dcalc typed diff --git a/compiler/shared_ast/typing.ml b/compiler/shared_ast/typing.ml index e4d86da06..acaf4abb6 100644 --- a/compiler/shared_ast/typing.ml +++ b/compiler/shared_ast/typing.ml @@ -265,8 +265,8 @@ let handle_type_error ctx (A.AnyExpr e) t1 t2 = in Message.error ~fmt_pos "Error during typechecking, incompatible types:@\n\ - @[@{@<3>%s@} @[%a@]@,\ - @{@<3>%s@} @[%a@]@]" "┌─⯈" (format_typ ctx) t1 "└─⯈" + @[@{@<2>%s@} @[%a@]@,\ + @{@<2>%s@} @[%a@]@]" "─➤" (format_typ ctx) t1 "─➤" (format_typ ctx) t2 let lit_type (lit : A.lit) : naked_typ = diff --git a/doc/syntax/syntax_en.catala_en b/doc/syntax/syntax_en.catala_en index 37ad6db77..63c4c6b0a 100644 --- a/doc/syntax/syntax_en.catala_en +++ b/doc/syntax/syntax_en.catala_en @@ -252,12 +252,14 @@ to ensure that the *syntax* is correct. ```catala-test-inline $ catala typecheck -[ERROR] No scope named Scope0 found - -┌─⯈ doc/syntax/syntax_en.catala_en:94.14-94.20: -└──┐ -94 │ sub1 scope Scope0 - │ ‾‾‾‾‾‾ - └─ Metadata declaration +┌─[ERROR]─ +│ +│ No scope named Scope0 found +│ +├─➤ doc/syntax/syntax_en.catala_en:94.14-94.20: +│ │ +│ 94 │ sub1 scope Scope0 +│ │ ‾‾‾‾‾‾ +└─ Metadata declaration #return code 123# ``` diff --git a/doc/syntax/syntax_fr.catala_fr b/doc/syntax/syntax_fr.catala_fr index 15fafdf44..37c757b1c 100644 --- a/doc/syntax/syntax_fr.catala_fr +++ b/doc/syntax/syntax_fr.catala_fr @@ -250,12 +250,14 @@ to ensure that the *syntax* is correct. ```catala-test-inline $ catala typecheck -[ERROR] No scope named Scope0 found - -┌─⯈ doc/syntax/syntax_fr.catala_fr:92.28-92.34: -└──┐ -92 │ sub1 champ d'application Scope0 - │ ‾‾‾‾‾‾ - └─ Déclaration des métadonnées +┌─[ERROR]─ +│ +│ No scope named Scope0 found +│ +├─➤ doc/syntax/syntax_fr.catala_fr:92.28-92.34: +│ │ +│ 92 │ sub1 champ d'application Scope0 +│ │ ‾‾‾‾‾‾ +└─ Déclaration des métadonnées #return code 123# ``` diff --git a/tests/arithmetic/bad/division_by_zero.catala_en b/tests/arithmetic/bad/division_by_zero.catala_en index 2d69ea634..7e2dad620 100644 --- a/tests/arithmetic/bad/division_by_zero.catala_en +++ b/tests/arithmetic/bad/division_by_zero.catala_en @@ -33,42 +33,48 @@ scope Money: ```catala-test-inline $ catala test-scope Dec -[ERROR] During evaluation: a value is being used as denominator in a division - and it computed to zero. - -┌─⯈ tests/arithmetic/bad/division_by_zero.catala_en:20.28-20.30: -└──┐ -20 │ definition i equals 1. / 0. - │ ‾‾ - └┬ `Division_by_zero` exception management - └─ with decimals +┌─[ERROR]─ +│ +│ During evaluation: a value is being used as denominator in a division and +│ it computed to zero. +│ +├─➤ tests/arithmetic/bad/division_by_zero.catala_en:20.28-20.30: +│ │ +│ 20 │ definition i equals 1. / 0. +│ │ ‾‾ +└─ `Division_by_zero` exception management + └─ with decimals #return code 123# ``` ```catala-test-inline $ catala test-scope Int -[ERROR] During evaluation: a value is being used as denominator in a division - and it computed to zero. - -┌─⯈ tests/arithmetic/bad/division_by_zero.catala_en:10.27-10.28: -└──┐ -10 │ definition i equals 1 / 0 - │ ‾ - └┬ `Division_by_zero` exception management - └─ with integers +┌─[ERROR]─ +│ +│ During evaluation: a value is being used as denominator in a division and +│ it computed to zero. +│ +├─➤ tests/arithmetic/bad/division_by_zero.catala_en:10.27-10.28: +│ │ +│ 10 │ definition i equals 1 / 0 +│ │ ‾ +└─ `Division_by_zero` exception management + └─ with integers #return code 123# ``` ```catala-test-inline $ catala test-scope Money -[ERROR] During evaluation: a value is being used as denominator in a division - and it computed to zero. - -┌─⯈ tests/arithmetic/bad/division_by_zero.catala_en:30.31-30.35: -└──┐ -30 │ definition i equals $10.0 / $0.0 - │ ‾‾‾‾ - └┬ `Division_by_zero` exception management - └─ with money +┌─[ERROR]─ +│ +│ During evaluation: a value is being used as denominator in a division and +│ it computed to zero. +│ +├─➤ tests/arithmetic/bad/division_by_zero.catala_en:30.31-30.35: +│ │ +│ 30 │ definition i equals $10.0 / $0.0 +│ │ ‾‾‾‾ +└─ `Division_by_zero` exception management + └─ with money #return code 123# ``` diff --git a/tests/arithmetic/bad/logical_prio.catala_en b/tests/arithmetic/bad/logical_prio.catala_en index d1ec1a5aa..cc9c3da0f 100644 --- a/tests/arithmetic/bad/logical_prio.catala_en +++ b/tests/arithmetic/bad/logical_prio.catala_en @@ -8,17 +8,20 @@ scope S1: ```catala-test-inline $ catala typecheck -[ERROR] Please add parentheses to explicit which of these operators should be - applied first - -┌─⯈ tests/arithmetic/bad/logical_prio.catala_en:6.28-6.31: -└─┐ -6 │ definition o equals true and (false and true and true) or false - │ ‾‾‾ - -┌─⯈ tests/arithmetic/bad/logical_prio.catala_en:6.58-6.60: -└─┐ -6 │ definition o equals true and (false and true and true) or false - │ ‾‾ +┌─[ERROR]─ +│ +│ Please add parentheses to explicit which of these operators should be +│ applied first +│ +├─➤ tests/arithmetic/bad/logical_prio.catala_en:6.28-6.31: +│ │ +│ 6 │ definition o equals true and (false and true and true) or false +│ │ ‾‾‾ +│ +├─➤ tests/arithmetic/bad/logical_prio.catala_en:6.58-6.60: +│ │ +│ 6 │ definition o equals true and (false and true and true) or false +│ │ ‾‾ +└─ #return code 123# ``` diff --git a/tests/arithmetic/good/priorities.catala_en b/tests/arithmetic/good/priorities.catala_en index e24601dc6..3a1e352d7 100644 --- a/tests/arithmetic/good/priorities.catala_en +++ b/tests/arithmetic/good/priorities.catala_en @@ -16,15 +16,20 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] w = 0 -[RESULT] x = 4 -[RESULT] y = 4 -[RESULT] z = 390.0 +┌─[RESULT]─ +│ w = 0 +│ x = 4 +│ y = 4 +│ z = 390.0 +└─ ``` diff --git a/tests/arithmetic/good/rounding.catala_en b/tests/arithmetic/good/rounding.catala_en index 091a0711c..5f1c9c0a3 100644 --- a/tests/arithmetic/good/rounding.catala_en +++ b/tests/arithmetic/good/rounding.catala_en @@ -46,6 +46,7 @@ scope A: ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] o = false +┌─[RESULT]─ +│ o = false +└─ ``` diff --git a/tests/arithmetic/good/trivial.catala_en b/tests/arithmetic/good/trivial.catala_en index c4dccecda..cf2d0948a 100644 --- a/tests/arithmetic/good/trivial.catala_en +++ b/tests/arithmetic/good/trivial.catala_en @@ -10,12 +10,17 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] w = 6 +┌─[RESULT]─ +│ w = 6 +└─ ``` diff --git a/tests/array/bad/fold_error.catala_en b/tests/array/bad/fold_error.catala_en index 3f886c0cf..2044a9d0a 100644 --- a/tests/array/bad/fold_error.catala_en +++ b/tests/array/bad/fold_error.catala_en @@ -12,26 +12,28 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] I don't know how to apply operator >= on types integer and money - -┌─⯈ tests/array/bad/fold_error.catala_en:10.78-10.85: -└──┐ -10 │ definition list_high_count equals number of list of m among list such that m >= $7 - │ ‾‾‾‾‾‾‾ - └─ Article - -Type integer coming from expression: -┌─⯈ tests/array/bad/fold_error.catala_en:5.32-5.39: -└─┐ -5 │ context list content list of integer - │ ‾‾‾‾‾‾‾ - └─ Article - -Type money coming from expression: -┌─⯈ tests/array/bad/fold_error.catala_en:10.83-10.85: -└──┐ -10 │ definition list_high_count equals number of list of m among list such that m >= $7 - │ ‾‾ - └─ Article +┌─[ERROR]─ +│ +│ I don't know how to apply operator >= on types integer and money +│ +├─➤ tests/array/bad/fold_error.catala_en:10.78-10.85: +│ │ +│ 10 │ definition list_high_count equals number of list of m among list such that m >= $7 +│ │ ‾‾‾‾‾‾‾ +├─ Article +│ +│ Type integer coming from expression: +├─➤ tests/array/bad/fold_error.catala_en:5.32-5.39: +│ │ +│ 5 │ context list content list of integer +│ │ ‾‾‾‾‾‾‾ +├─ Article +│ +│ Type money coming from expression: +├─➤ tests/array/bad/fold_error.catala_en:10.83-10.85: +│ │ +│ 10 │ definition list_high_count equals number of list of m among list such that m >= $7 +│ │ ‾‾ +└─ Article #return code 123# ``` diff --git a/tests/array/good/aggregation.catala_en b/tests/array/good/aggregation.catala_en index 08f4097b8..62bbc2895 100644 --- a/tests/array/good/aggregation.catala_en +++ b/tests/array/good/aggregation.catala_en @@ -27,21 +27,27 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = [$0.00; $9.00; $5.20] +┌─[RESULT]─ +│ x = [$0.00; $9.00; $5.20] +└─ ``` ```catala-test-inline $ catala test-scope B -[RESULT] Computation successful! Results: -[RESULT] max = $18.00 -[RESULT] min = $5.00 -[RESULT] y = $17.20 -[RESULT] z = 1 +┌─[RESULT]─ +│ max = $18.00 +│ min = $5.00 +│ y = $17.20 +│ z = 1 +└─ ``` diff --git a/tests/array/good/aggregation_2.catala_en b/tests/array/good/aggregation_2.catala_en index 8b51bf80b..54e7572af 100644 --- a/tests/array/good/aggregation_2.catala_en +++ b/tests/array/good/aggregation_2.catala_en @@ -33,24 +33,29 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] -x = - [ - S { -- id: 0 -- income: $0.00 }; S { -- id: 1 -- income: $9.00 }; - S { -- id: 2 -- income: $5.20 } - ] +┌─[RESULT]─ +│ x = +│ [ +│ S { -- id: 0 -- income: $0.00 }; S { -- id: 1 -- income: $9.00 }; +│ S { -- id: 2 -- income: $5.20 } +│ ] +└─ ``` ```catala-test-inline $ catala test-scope B -[RESULT] Computation successful! Results: -[RESULT] argmax = S { -- id: 1 -- income: $9.00 } -[RESULT] argmin = S { -- id: 0 -- income: $0.00 } +┌─[RESULT]─ +│ argmax = S { -- id: 1 -- income: $9.00 } +│ argmin = S { -- id: 0 -- income: $0.00 } +└─ ``` diff --git a/tests/array/good/aggregation_3.catala_en b/tests/array/good/aggregation_3.catala_en index b8bb41f15..2ab58e85e 100644 --- a/tests/array/good/aggregation_3.catala_en +++ b/tests/array/good/aggregation_3.catala_en @@ -35,8 +35,12 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline @@ -90,6 +94,7 @@ let scope S (x: integer|internal|output) = ```catala-test-inline $ catala test-scope S -[RESULT] Computation successful! Results: -[RESULT] x = 0 +┌─[RESULT]─ +│ x = 0 +└─ ``` diff --git a/tests/array/good/concatenation.catala_en b/tests/array/good/concatenation.catala_en index 97ae13ef1..9c7e95ccd 100644 --- a/tests/array/good/concatenation.catala_en +++ b/tests/array/good/concatenation.catala_en @@ -14,13 +14,18 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = [0; 1; 2; 3; 4; 5; 6] -[RESULT] y = [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10] +┌─[RESULT]─ +│ x = [0; 1; 2; 3; 4; 5; 6] +│ y = [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10] +└─ ``` diff --git a/tests/array/good/filter.catala_en b/tests/array/good/filter.catala_en index 5fd105b98..112abe9a5 100644 --- a/tests/array/good/filter.catala_en +++ b/tests/array/good/filter.catala_en @@ -20,18 +20,24 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = [$0.00; $9.00; $5.20] +┌─[RESULT]─ +│ x = [$0.00; $9.00; $5.20] +└─ ``` ```catala-test-inline $ catala test-scope B -[RESULT] Computation successful! Results: -[RESULT] y = [$9.00; $5.20] +┌─[RESULT]─ +│ y = [$9.00; $5.20] +└─ ``` diff --git a/tests/array/good/filter_map.catala_en b/tests/array/good/filter_map.catala_en index 7c182c1a5..29e3485fd 100644 --- a/tests/array/good/filter_map.catala_en +++ b/tests/array/good/filter_map.catala_en @@ -21,19 +21,25 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = [$0.00; $9.00; $5.20] +┌─[RESULT]─ +│ x = [$0.00; $9.00; $5.20] +└─ ``` ```catala-test-inline $ catala test-scope B -[RESULT] Computation successful! Results: -[RESULT] y = [$9.00; $5.20] -[RESULT] z = [false; true; true] +┌─[RESULT]─ +│ y = [$9.00; $5.20] +│ z = [false; true; true] +└─ ``` diff --git a/tests/array/good/fold.catala_en b/tests/array/good/fold.catala_en index 8b51bf80b..54e7572af 100644 --- a/tests/array/good/fold.catala_en +++ b/tests/array/good/fold.catala_en @@ -33,24 +33,29 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] -x = - [ - S { -- id: 0 -- income: $0.00 }; S { -- id: 1 -- income: $9.00 }; - S { -- id: 2 -- income: $5.20 } - ] +┌─[RESULT]─ +│ x = +│ [ +│ S { -- id: 0 -- income: $0.00 }; S { -- id: 1 -- income: $9.00 }; +│ S { -- id: 2 -- income: $5.20 } +│ ] +└─ ``` ```catala-test-inline $ catala test-scope B -[RESULT] Computation successful! Results: -[RESULT] argmax = S { -- id: 1 -- income: $9.00 } -[RESULT] argmin = S { -- id: 0 -- income: $0.00 } +┌─[RESULT]─ +│ argmax = S { -- id: 1 -- income: $9.00 } +│ argmin = S { -- id: 0 -- income: $0.00 } +└─ ``` diff --git a/tests/array/good/map.catala_en b/tests/array/good/map.catala_en index 9b5fde222..24e936914 100644 --- a/tests/array/good/map.catala_en +++ b/tests/array/good/map.catala_en @@ -14,13 +14,18 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope B -[RESULT] Computation successful! Results: -[RESULT] x = [$4.00; $8.00] -[RESULT] z = [false; true] +┌─[RESULT]─ +│ x = [$4.00; $8.00] +│ z = [false; true] +└─ ``` diff --git a/tests/array/good/simple.catala_en b/tests/array/good/simple.catala_en index 8adec733f..a13bfbafb 100644 --- a/tests/array/good/simple.catala_en +++ b/tests/array/good/simple.catala_en @@ -25,21 +25,27 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = [0; 9; 64] +┌─[RESULT]─ +│ x = [0; 9; 64] +└─ ``` ```catala-test-inline $ catala test-scope B -[RESULT] Computation successful! Results: -[RESULT] v = 3 -[RESULT] w = true -[RESULT] y = true -[RESULT] z = false +┌─[RESULT]─ +│ v = 3 +│ w = true +│ y = true +│ z = false +└─ ``` diff --git a/tests/array/good/simpler.catala_en b/tests/array/good/simpler.catala_en index fccb636f4..7396fbb36 100644 --- a/tests/array/good/simpler.catala_en +++ b/tests/array/good/simpler.catala_en @@ -14,13 +14,18 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] w = false -[RESULT] x = [0; 9; 64] +┌─[RESULT]─ +│ w = false +│ x = [0; 9; 64] +└─ ``` diff --git a/tests/array/good/simplest.catala_en b/tests/array/good/simplest.catala_en index 73773ef47..b173b1f13 100644 --- a/tests/array/good/simplest.catala_en +++ b/tests/array/good/simplest.catala_en @@ -12,12 +12,17 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = [0; 4; 8] +┌─[RESULT]─ +│ x = [0; 4; 8] +└─ ``` diff --git a/tests/bool/bad/bad_assert.catala_en b/tests/bool/bad/bad_assert.catala_en index 161467dfc..860f3631a 100644 --- a/tests/bool/bad/bad_assert.catala_en +++ b/tests/bool/bad/bad_assert.catala_en @@ -12,29 +12,31 @@ scope Foo: ```catala-test-inline $ catala test-scope Foo -[ERROR] Error during typechecking, incompatible types: - ┌─⯈ integer - └─⯈ bool - -While typechecking the following expression: -┌─⯈ tests/bool/bad/bad_assert.catala_en:9.13-9.14: -└─┐ -9 │ assertion x - │ ‾ - └─ Test - -Type integer is coming from: -┌─⯈ tests/bool/bad/bad_assert.catala_en:5.20-5.27: -└─┐ -5 │ output x content integer - │ ‾‾‾‾‾‾‾ - └─ Test - -Type bool is coming from: -┌─⯈ tests/bool/bad/bad_assert.catala_en:9.13-9.14: -└─┐ -9 │ assertion x - │ ‾ - └─ Test +┌─[ERROR]─ +│ +│ Error during typechecking, incompatible types: +│ ─➤ integer +│ ─➤ bool +│ +│ While typechecking the following expression: +├─➤ tests/bool/bad/bad_assert.catala_en:9.13-9.14: +│ │ +│ 9 │ assertion x +│ │ ‾ +├─ Test +│ +│ Type integer is coming from: +├─➤ tests/bool/bad/bad_assert.catala_en:5.20-5.27: +│ │ +│ 5 │ output x content integer +│ │ ‾‾‾‾‾‾‾ +├─ Test +│ +│ Type bool is coming from: +├─➤ tests/bool/bad/bad_assert.catala_en:9.13-9.14: +│ │ +│ 9 │ assertion x +│ │ ‾ +└─ Test #return code 123# ``` diff --git a/tests/bool/bad/test_xor_with_int.catala_en b/tests/bool/bad/test_xor_with_int.catala_en index b2947663b..376658e77 100644 --- a/tests/bool/bad/test_xor_with_int.catala_en +++ b/tests/bool/bad/test_xor_with_int.catala_en @@ -10,22 +10,24 @@ scope TestXorWithInt: ```catala-test-inline $ catala Typecheck -[ERROR] Error during typechecking, incompatible types: - ┌─⯈ integer - └─⯈ bool - -This expression has type integer: -┌─⯈ tests/bool/bad/test_xor_with_int.catala_en:8.30-8.32: -└─┐ -8 │ definition test_var equals 10 xor 20 - │ ‾‾ - └─ 'xor' should be a boolean operator - -Expected type bool coming from expression: -┌─⯈ tests/bool/bad/test_xor_with_int.catala_en:8.33-8.36: -└─┐ -8 │ definition test_var equals 10 xor 20 - │ ‾‾‾ - └─ 'xor' should be a boolean operator +┌─[ERROR]─ +│ +│ Error during typechecking, incompatible types: +│ ─➤ integer +│ ─➤ bool +│ +│ This expression has type integer: +├─➤ tests/bool/bad/test_xor_with_int.catala_en:8.30-8.32: +│ │ +│ 8 │ definition test_var equals 10 xor 20 +│ │ ‾‾ +├─ 'xor' should be a boolean operator +│ +│ Expected type bool coming from expression: +├─➤ tests/bool/bad/test_xor_with_int.catala_en:8.33-8.36: +│ │ +│ 8 │ definition test_var equals 10 xor 20 +│ │ ‾‾‾ +└─ 'xor' should be a boolean operator #return code 123# ``` diff --git a/tests/bool/good/test_bool.catala_en b/tests/bool/good/test_bool.catala_en index bc637b471..577f84464 100644 --- a/tests/bool/good/test_bool.catala_en +++ b/tests/bool/good/test_bool.catala_en @@ -15,8 +15,12 @@ scope TestBool: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline @@ -43,9 +47,10 @@ TestBool ```catala-test-inline $ catala test-scope TestBool -[RESULT] Computation successful! Results: -[RESULT] bar = 1 -[RESULT] foo = true +┌─[RESULT]─ +│ bar = 1 +│ foo = true +└─ ``` ```catala-test-inline diff --git a/tests/bool/good/test_precedence.catala_en b/tests/bool/good/test_precedence.catala_en index 049204914..fc5dc6ca5 100644 --- a/tests/bool/good/test_precedence.catala_en +++ b/tests/bool/good/test_precedence.catala_en @@ -12,12 +12,17 @@ scope TestBool: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope TestBool -[RESULT] Computation successful! Results: -[RESULT] foo = true +┌─[RESULT]─ +│ foo = true +└─ ``` diff --git a/tests/bool/good/test_xor.catala_en b/tests/bool/good/test_xor.catala_en index 2ca9390ef..03f9359d3 100644 --- a/tests/bool/good/test_xor.catala_en +++ b/tests/bool/good/test_xor.catala_en @@ -18,15 +18,20 @@ scope TestXor: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope TestXor -[RESULT] Computation successful! Results: -[RESULT] f_xor_f = false -[RESULT] f_xor_t = true -[RESULT] t_xor_f = true -[RESULT] t_xor_t = false +┌─[RESULT]─ +│ f_xor_f = false +│ f_xor_t = true +│ t_xor_f = true +│ t_xor_t = false +└─ ``` diff --git a/tests/date/bad/rounding_option_conflict.catala_en b/tests/date/bad/rounding_option_conflict.catala_en index 139199cb0..7e4e5e34e 100644 --- a/tests/date/bad/rounding_option_conflict.catala_en +++ b/tests/date/bad/rounding_option_conflict.catala_en @@ -25,16 +25,19 @@ scope Test: ```catala-test-inline $ catala test-scope Test -[ERROR] You cannot set multiple date rounding modes - -┌─⯈ tests/date/bad/rounding_option_conflict.catala_en:10.14-10.24: -└──┐ -10 │ date round decreasing - │ ‾‾‾‾‾‾‾‾‾‾ - -┌─⯈ tests/date/bad/rounding_option_conflict.catala_en:12.14-12.24: -└──┐ -12 │ date round increasing - │ ‾‾‾‾‾‾‾‾‾‾ +┌─[ERROR]─ +│ +│ You cannot set multiple date rounding modes +│ +├─➤ tests/date/bad/rounding_option_conflict.catala_en:10.14-10.24: +│ │ +│ 10 │ date round decreasing +│ │ ‾‾‾‾‾‾‾‾‾‾ +│ +├─➤ tests/date/bad/rounding_option_conflict.catala_en:12.14-12.24: +│ │ +│ 12 │ date round increasing +│ │ ‾‾‾‾‾‾‾‾‾‾ +└─ #return code 123# ``` diff --git a/tests/date/bad/rounding_option_en.catala_en b/tests/date/bad/rounding_option_en.catala_en index 09d2a6bb0..c43fbbae0 100644 --- a/tests/date/bad/rounding_option_en.catala_en +++ b/tests/date/bad/rounding_option_en.catala_en @@ -12,6 +12,10 @@ scope Test: ```catala-test-inline $ catala test-scope Test -[ERROR] Unexpected error: Dates_calc.Dates.AmbiguousComputation +┌─[ERROR]─ +│ +│ Unexpected error: Dates_calc.Dates.AmbiguousComputation +│ +└─ #return code 125# ``` diff --git a/tests/date/bad/rounding_option_fr.catala_fr b/tests/date/bad/rounding_option_fr.catala_fr index ffcecfe7b..dd9208a72 100644 --- a/tests/date/bad/rounding_option_fr.catala_fr +++ b/tests/date/bad/rounding_option_fr.catala_fr @@ -12,6 +12,10 @@ champ d'application Test: ```catala-test-inline $ catala test-scope Test -[ERROR] Unexpected error: Dates_calc.Dates.AmbiguousComputation +┌─[ERROR]─ +│ +│ Unexpected error: Dates_calc.Dates.AmbiguousComputation +│ +└─ #return code 125# ``` diff --git a/tests/date/bad/substraction.catala_en b/tests/date/bad/substraction.catala_en index 8e6c32430..cc55e7a6d 100644 --- a/tests/date/bad/substraction.catala_en +++ b/tests/date/bad/substraction.catala_en @@ -8,23 +8,26 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] I don't know how to apply operator <= on types date and duration - -┌─⯈ tests/date/bad/substraction.catala_en:6.23-6.52: -└─┐ -6 │ definition o equals |2024-01-16| - 0 day <= 0 day - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - -Type date coming from expression: -┌─⯈ tests/date/bad/substraction.catala_en:6.23-6.43: -└─┐ -6 │ definition o equals |2024-01-16| - 0 day <= 0 day - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - -Type duration coming from expression: -┌─⯈ tests/date/bad/substraction.catala_en:6.47-6.52: -└─┐ -6 │ definition o equals |2024-01-16| - 0 day <= 0 day - │ ‾‾‾‾‾ +┌─[ERROR]─ +│ +│ I don't know how to apply operator <= on types date and duration +│ +├─➤ tests/date/bad/substraction.catala_en:6.23-6.52: +│ │ +│ 6 │ definition o equals |2024-01-16| - 0 day <= 0 day +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +│ +│ Type date coming from expression: +├─➤ tests/date/bad/substraction.catala_en:6.23-6.43: +│ │ +│ 6 │ definition o equals |2024-01-16| - 0 day <= 0 day +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +│ +│ Type duration coming from expression: +├─➤ tests/date/bad/substraction.catala_en:6.47-6.52: +│ │ +│ 6 │ definition o equals |2024-01-16| - 0 day <= 0 day +│ │ ‾‾‾‾‾ +└─ #return code 123# ``` diff --git a/tests/date/bad/uncomparable_duration.catala_en b/tests/date/bad/uncomparable_duration.catala_en index 90eda7836..6b7fb5d5d 100644 --- a/tests/date/bad/uncomparable_duration.catala_en +++ b/tests/date/bad/uncomparable_duration.catala_en @@ -42,56 +42,64 @@ scope Ge: ```catala-test-inline $ catala test-scope Ge -[ERROR] During evaluation: ambiguous comparison between durations in - different units (e.g. months vs. days). - -┌─⯈ tests/date/bad/uncomparable_duration.catala_en:40.31-40.33: -└──┐ -40 │ definition d equals 1 month >= 2 day - │ ‾‾ - └┬ `UncomparableDurations` exception management - └─ `>=` operator +┌─[ERROR]─ +│ +│ During evaluation: ambiguous comparison between durations in different +│ units (e.g. months vs. days). +│ +├─➤ tests/date/bad/uncomparable_duration.catala_en:40.31-40.33: +│ │ +│ 40 │ definition d equals 1 month >= 2 day +│ │ ‾‾ +└─ `UncomparableDurations` exception management + └─ `>=` operator #return code 123# ``` ```catala-test-inline $ catala test-scope Gt -[ERROR] During evaluation: ambiguous comparison between durations in - different units (e.g. months vs. days). - -┌─⯈ tests/date/bad/uncomparable_duration.catala_en:30.31-30.32: -└──┐ -30 │ definition d equals 1 month > 2 day - │ ‾ - └┬ `UncomparableDurations` exception management - └─ `<=` operator +┌─[ERROR]─ +│ +│ During evaluation: ambiguous comparison between durations in different +│ units (e.g. months vs. days). +│ +├─➤ tests/date/bad/uncomparable_duration.catala_en:30.31-30.32: +│ │ +│ 30 │ definition d equals 1 month > 2 day +│ │ ‾ +└─ `UncomparableDurations` exception management + └─ `<=` operator #return code 123# ``` ```catala-test-inline $ catala test-scope Le -[ERROR] During evaluation: ambiguous comparison between durations in - different units (e.g. months vs. days). - -┌─⯈ tests/date/bad/uncomparable_duration.catala_en:20.31-20.33: -└──┐ -20 │ definition d equals 1 month <= 2 day - │ ‾‾ - └┬ `UncomparableDurations` exception management - └─ `<=` operator +┌─[ERROR]─ +│ +│ During evaluation: ambiguous comparison between durations in different +│ units (e.g. months vs. days). +│ +├─➤ tests/date/bad/uncomparable_duration.catala_en:20.31-20.33: +│ │ +│ 20 │ definition d equals 1 month <= 2 day +│ │ ‾‾ +└─ `UncomparableDurations` exception management + └─ `<=` operator #return code 123# ``` ```catala-test-inline $ catala test-scope Lt -[ERROR] During evaluation: ambiguous comparison between durations in - different units (e.g. months vs. days). - -┌─⯈ tests/date/bad/uncomparable_duration.catala_en:10.31-10.32: -└──┐ -10 │ definition d equals 1 month < 2 day - │ ‾ - └┬ `UncomparableDurations` exception management - └─ `<` operator +┌─[ERROR]─ +│ +│ During evaluation: ambiguous comparison between durations in different +│ units (e.g. months vs. days). +│ +├─➤ tests/date/bad/uncomparable_duration.catala_en:10.31-10.32: +│ │ +│ 10 │ definition d equals 1 month < 2 day +│ │ ‾ +└─ `UncomparableDurations` exception management + └─ `<` operator #return code 123# ``` diff --git a/tests/date/good/durations.catala_en b/tests/date/good/durations.catala_en index 036b679d7..8adc6db1e 100644 --- a/tests/date/good/durations.catala_en +++ b/tests/date/good/durations.catala_en @@ -27,18 +27,23 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] m = [11874 days] -[RESULT] m2 = [6 months] -[RESULT] x = 2019-01-01 -[RESULT] y = 2002-09-30 -[RESULT] z = true -[RESULT] z2 = true -[RESULT] z3 = [5937 days] +┌─[RESULT]─ +│ m = [11874 days] +│ m2 = [6 months] +│ x = 2019-01-01 +│ y = 2002-09-30 +│ z = true +│ z2 = true +│ z3 = [5937 days] +└─ ``` diff --git a/tests/date/good/rounding_option_en.catala_en b/tests/date/good/rounding_option_en.catala_en index 22317efb0..040be03ef 100644 --- a/tests/date/good/rounding_option_en.catala_en +++ b/tests/date/good/rounding_option_en.catala_en @@ -26,12 +26,17 @@ scope Test: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope Test -[RESULT] Computation successful! Results: -[RESULT] r = true +┌─[RESULT]─ +│ r = true +└─ ``` diff --git a/tests/date/good/rounding_option_fr.catala_fr b/tests/date/good/rounding_option_fr.catala_fr index 30d772cf5..9c129a43b 100644 --- a/tests/date/good/rounding_option_fr.catala_fr +++ b/tests/date/good/rounding_option_fr.catala_fr @@ -26,12 +26,17 @@ champ d'application Test: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope Test -[RESULT] Computation successful! Results: -[RESULT] r = vrai +┌─[RESULT]─ +│ r = vrai +└─ ``` diff --git a/tests/date/good/simple.catala_en b/tests/date/good/simple.catala_en index 6fb661a28..388c23fee 100644 --- a/tests/date/good/simple.catala_en +++ b/tests/date/good/simple.catala_en @@ -16,14 +16,19 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = 2019-01-01 -[RESULT] y = 2002-09-30 -[RESULT] z = [5937 days] +┌─[RESULT]─ +│ x = 2019-01-01 +│ y = 2002-09-30 +│ z = [5937 days] +└─ ``` diff --git a/tests/dec/good/infinite_precision.catala_en b/tests/dec/good/infinite_precision.catala_en index 11cf34a45..f7da19658 100644 --- a/tests/dec/good/infinite_precision.catala_en +++ b/tests/dec/good/infinite_precision.catala_en @@ -18,17 +18,21 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] -a = - -0.000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,078,695,580,959,228,473,468… -[RESULT] x = 84.648,665,652,656,896,23 -[RESULT] y = -4.368,297,787,053,206,549,8 -[RESULT] z = 654,265,429,805,103,220,650,980,650.5… +┌─[RESULT]─ +│ a = +│ -0.000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,078,695,580,959,228,473,468… +│ x = 84.648,665,652,656,896,23 +│ y = -4.368,297,787,053,206,549,8 +│ z = 654,265,429,805,103,220,650,980,650.5… +└─ ``` diff --git a/tests/dec/good/rounding.catala_en b/tests/dec/good/rounding.catala_en index ab698580b..da82f7d6b 100644 --- a/tests/dec/good/rounding.catala_en +++ b/tests/dec/good/rounding.catala_en @@ -18,15 +18,20 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = 84.648,665 -[RESULT] x1 = 85.0 -[RESULT] y = 4.368,297 -[RESULT] y1 = 4.0 +┌─[RESULT]─ +│ x = 84.648,665 +│ x1 = 85.0 +│ y = 4.368,297 +│ y1 = 4.0 +└─ ``` diff --git a/tests/dec/good/simple.catala_en b/tests/dec/good/simple.catala_en index d3187b685..c122f9477 100644 --- a/tests/dec/good/simple.catala_en +++ b/tests/dec/good/simple.catala_en @@ -18,15 +18,20 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] k = 0.333,333,333,333,333,333,33… -[RESULT] x = 84.648,665 -[RESULT] y = 4.368,297 -[RESULT] z = 19.377,955,528,206,987,757… +┌─[RESULT]─ +│ k = 0.333,333,333,333,333,333,33… +│ x = 84.648,665 +│ y = 4.368,297 +│ z = 19.377,955,528,206,987,757… +└─ ``` diff --git a/tests/dec/good/zero_after_comma.catala_en b/tests/dec/good/zero_after_comma.catala_en index 00a4d8321..72f1b628f 100644 --- a/tests/dec/good/zero_after_comma.catala_en +++ b/tests/dec/good/zero_after_comma.catala_en @@ -15,13 +15,18 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = 4.0 -[RESULT] y = 1.04 +┌─[RESULT]─ +│ x = 4.0 +│ y = 1.04 +└─ ``` diff --git a/tests/default/bad/empty.catala_en b/tests/default/bad/empty.catala_en index 5fc1fab1c..b75a89664 100644 --- a/tests/default/bad/empty.catala_en +++ b/tests/default/bad/empty.catala_en @@ -11,21 +11,25 @@ scope A: ```catala-test-inline $ catala test-scope A -[WARNING] In scope "A", the variable "y" is declared but never defined; - did you forget something? - -┌─⯈ tests/default/bad/empty.catala_en:6.10-6.11: -└─┐ -6 │ output y content boolean - │ ‾ - └─ Article -[ERROR] During evaluation: no applicable rule to define this variable in this - situation. - -┌─⯈ tests/default/bad/empty.catala_en:6.10-6.11: -└─┐ -6 │ output y content boolean - │ ‾ - └─ Article +┌─[WARNING]─ +│ +│ In scope "A", the variable "y" is declared but never defined; +│ did you forget something? +│ +├─➤ tests/default/bad/empty.catala_en:6.10-6.11: +│ │ +│ 6 │ output y content boolean +│ │ ‾ +└─ Article +┌─[ERROR]─ +│ +│ During evaluation: no applicable rule to define this variable in this +│ situation. +│ +├─➤ tests/default/bad/empty.catala_en:6.10-6.11: +│ │ +│ 6 │ output y content boolean +│ │ ‾ +└─ Article #return code 123# ``` diff --git a/tests/default/bad/empty_with_rules.catala_en b/tests/default/bad/empty_with_rules.catala_en index 45a3918c6..c41a0f7f7 100644 --- a/tests/default/bad/empty_with_rules.catala_en +++ b/tests/default/bad/empty_with_rules.catala_en @@ -14,13 +14,15 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] During evaluation: no applicable rule to define this variable in this - situation. - -┌─⯈ tests/default/bad/empty_with_rules.catala_en:5.10-5.11: -└─┐ -5 │ output x content integer - │ ‾ - └─ Article +┌─[ERROR]─ +│ +│ During evaluation: no applicable rule to define this variable in this +│ situation. +│ +├─➤ tests/default/bad/empty_with_rules.catala_en:5.10-5.11: +│ │ +│ 5 │ output x content integer +│ │ ‾ +└─ Article #return code 123# ``` diff --git a/tests/default/bad/typing_or_logical_error.catala_en b/tests/default/bad/typing_or_logical_error.catala_en index 6c55bb2c9..699f337d5 100644 --- a/tests/default/bad/typing_or_logical_error.catala_en +++ b/tests/default/bad/typing_or_logical_error.catala_en @@ -11,18 +11,21 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] Syntax error at "=" - » expected 'under condition' followed by a condition, 'equals' followed by - the definition body, or the rest of the variable qualified name - Those are valid at this point: "of", "state", "equals", "under condition", - "." - -Last good token -┌─⯈ tests/default/bad/typing_or_logical_error.catala_en:8.13-8.29: -└─┐ -8 │ definition wrong_definition = 1 - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - -Maybe you wanted to write : "." +┌─[ERROR]─ +│ +│ Syntax error at "=" +│ » expected 'under condition' followed by a condition, 'equals' followed by +│ the definition body, or the rest of the variable qualified name +│ Those are valid at this point: "of", "state", "equals", "under condition", +│ "." +│ +│ Last good token +├─➤ tests/default/bad/typing_or_logical_error.catala_en:8.13-8.29: +│ │ +│ 8 │ definition wrong_definition = 1 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +│ +│ Maybe you wanted to write : "." ? +└─ #return code 123# ``` diff --git a/tests/default/good/mutliple_definitions.catala_en b/tests/default/good/mutliple_definitions.catala_en index ac569c065..9b10ad105 100644 --- a/tests/default/good/mutliple_definitions.catala_en +++ b/tests/default/good/mutliple_definitions.catala_en @@ -13,36 +13,47 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[WARNING] These definitions have identical justifications and consequences; - is it a mistake? - -┌─⯈ tests/default/good/mutliple_definitions.catala_en:9.3-9.15: -└─┐ -9 │ definition w equals 3 - │ ‾‾‾‾‾‾‾‾‾‾‾‾ - -┌─⯈ tests/default/good/mutliple_definitions.catala_en:6.3-6.15: -└─┐ -6 │ definition w equals 3 - │ ‾‾‾‾‾‾‾‾‾‾‾‾ -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[WARNING]─ +│ +│ These definitions have identical justifications and consequences; +│ is it a mistake? +│ +├─➤ tests/default/good/mutliple_definitions.catala_en:9.3-9.15: +│ │ +│ 9 │ definition w equals 3 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾ +│ +├─➤ tests/default/good/mutliple_definitions.catala_en:6.3-6.15: +│ │ +│ 6 │ definition w equals 3 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾ +└─ +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[WARNING] These definitions have identical justifications and consequences; - is it a mistake? - -┌─⯈ tests/default/good/mutliple_definitions.catala_en:9.3-9.15: -└─┐ -9 │ definition w equals 3 - │ ‾‾‾‾‾‾‾‾‾‾‾‾ - -┌─⯈ tests/default/good/mutliple_definitions.catala_en:6.3-6.15: -└─┐ -6 │ definition w equals 3 - │ ‾‾‾‾‾‾‾‾‾‾‾‾ -[RESULT] Computation successful! Results: -[RESULT] w = 3 +┌─[WARNING]─ +│ +│ These definitions have identical justifications and consequences; +│ is it a mistake? +│ +├─➤ tests/default/good/mutliple_definitions.catala_en:9.3-9.15: +│ │ +│ 9 │ definition w equals 3 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾ +│ +├─➤ tests/default/good/mutliple_definitions.catala_en:6.3-6.15: +│ │ +│ 6 │ definition w equals 3 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾ +└─ +┌─[RESULT]─ +│ w = 3 +└─ ``` diff --git a/tests/enum/bad/ambiguous_cases.catala_en b/tests/enum/bad/ambiguous_cases.catala_en index d8860ffa3..6b19f4109 100644 --- a/tests/enum/bad/ambiguous_cases.catala_en +++ b/tests/enum/bad/ambiguous_cases.catala_en @@ -16,13 +16,15 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] This constructor name is ambiguous, it can belong to E or F. - Disambiguate it by prefixing it with the enum name. - -┌─⯈ tests/enum/bad/ambiguous_cases.catala_en:14.23-14.28: -└──┐ -14 │ definition e equals Case1 - │ ‾‾‾‾‾ - └─ Article +┌─[ERROR]─ +│ +│ This constructor name is ambiguous, it can belong to E or F. +│ Disambiguate it by prefixing it with the enum name. +│ +├─➤ tests/enum/bad/ambiguous_cases.catala_en:14.23-14.28: +│ │ +│ 14 │ definition e equals Case1 +│ │ ‾‾‾‾‾ +└─ Article #return code 123# ``` diff --git a/tests/enum/bad/ambiguous_wildcard.catala_en b/tests/enum/bad/ambiguous_wildcard.catala_en index f90051039..a9a10718b 100644 --- a/tests/enum/bad/ambiguous_wildcard.catala_en +++ b/tests/enum/bad/ambiguous_wildcard.catala_en @@ -17,13 +17,15 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] Couldn't infer the enumeration name from lonely wildcard (wildcard - cannot be used as single match case) - -┌─⯈ tests/enum/bad/ambiguous_wildcard.catala_en:15.5-15.21: -└──┐ -15 │ -- anything : 31 - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Wildcard cannot be used as single match case +┌─[ERROR]─ +│ +│ Couldn't infer the enumeration name from lonely wildcard (wildcard cannot +│ be used as single match case) +│ +├─➤ tests/enum/bad/ambiguous_wildcard.catala_en:15.5-15.21: +│ │ +│ 15 │ -- anything : 31 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +└─ Wildcard cannot be used as single match case #return code 123# ``` diff --git a/tests/enum/bad/duplicate_case.catala_en b/tests/enum/bad/duplicate_case.catala_en index 348f9722c..57e6a7d67 100644 --- a/tests/enum/bad/duplicate_case.catala_en +++ b/tests/enum/bad/duplicate_case.catala_en @@ -20,18 +20,20 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] The constructor Case3 has been matched twice: - -┌─⯈ tests/enum/bad/duplicate_case.catala_en:18.16-18.20: -└──┐ -18 │ -- Case3 : true - │ ‾‾‾‾ - └─ Article - -┌─⯈ tests/enum/bad/duplicate_case.catala_en:17.16-17.21: -└──┐ -17 │ -- Case3 : false - │ ‾‾‾‾‾ - └─ Article +┌─[ERROR]─ +│ +│ The constructor Case3 has been matched twice: +│ +├─➤ tests/enum/bad/duplicate_case.catala_en:18.16-18.20: +│ │ +│ 18 │ -- Case3 : true +│ │ ‾‾‾‾ +├─ Article +│ +├─➤ tests/enum/bad/duplicate_case.catala_en:17.16-17.21: +│ │ +│ 17 │ -- Case3 : false +│ │ ‾‾‾‾‾ +└─ Article #return code 123# ``` diff --git a/tests/enum/bad/empty.catala_en b/tests/enum/bad/empty.catala_en index b52c0dde1..2a8686851 100644 --- a/tests/enum/bad/empty.catala_en +++ b/tests/enum/bad/empty.catala_en @@ -9,13 +9,15 @@ declaration scope Bar: ```catala-test-inline $ catala Typecheck -[ERROR] The enum Foo does not have any cases; - give it some for Catala to be able to accept it. - -┌─⯈ tests/enum/bad/empty.catala_en:4.25-4.28: -└─┐ -4 │ declaration enumeration Foo: - │ ‾‾‾ - └─ Test +┌─[ERROR]─ +│ +│ The enum Foo does not have any cases; +│ give it some for Catala to be able to accept it. +│ +├─➤ tests/enum/bad/empty.catala_en:4.25-4.28: +│ │ +│ 4 │ declaration enumeration Foo: +│ │ ‾‾‾ +└─ Test #return code 123# ``` diff --git a/tests/enum/bad/missing_case.catala_en b/tests/enum/bad/missing_case.catala_en index 4e8330299..875bbe4f0 100644 --- a/tests/enum/bad/missing_case.catala_en +++ b/tests/enum/bad/missing_case.catala_en @@ -18,24 +18,28 @@ scope A: ```catala-test-inline $ catala test-scope A -[WARNING] The constructor "Case3" of enumeration "E" is never used; - maybe it's unnecessary? - -┌─⯈ tests/enum/bad/missing_case.catala_en:7.6-7.11: -└─┐ -7 │ -- Case3 - │ ‾‾‾‾‾ - └─ Article -[ERROR] The constructor Case3 of enum E is missing from this pattern matching - -┌─⯈ tests/enum/bad/missing_case.catala_en:14.25-16.22: -└──┐ -14 │ definition out equals match e with pattern - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -15 │ -- Case1 of i : i = 0 - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -16 │ -- Case2 of b : b - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Article +┌─[WARNING]─ +│ +│ The constructor "Case3" of enumeration "E" is never used; +│ maybe it's unnecessary? +│ +├─➤ tests/enum/bad/missing_case.catala_en:7.6-7.11: +│ │ +│ 7 │ -- Case3 +│ │ ‾‾‾‾‾ +└─ Article +┌─[ERROR]─ +│ +│ The constructor Case3 of enum E is missing from this pattern matching +│ +├─➤ tests/enum/bad/missing_case.catala_en:14.25-16.22: +│ │ +│ 14 │ definition out equals match e with pattern +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +│ 15 │ -- Case1 of i : i = 0 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +│ 16 │ -- Case2 of b : b +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +└─ Article #return code 123# ``` diff --git a/tests/enum/bad/not_ending_wildcard.catala_en b/tests/enum/bad/not_ending_wildcard.catala_en index 72b34e278..1db5f7ee4 100644 --- a/tests/enum/bad/not_ending_wildcard.catala_en +++ b/tests/enum/bad/not_ending_wildcard.catala_en @@ -38,44 +38,48 @@ scope Middle_case: ```catala-test-inline $ catala test-scope First_case -[ERROR] Wildcard must be the last match case - -Not ending wildcard: -┌─⯈ tests/enum/bad/not_ending_wildcard.catala_en:19.5-19.21: -└──┐ -19 │ -- anything : 31 - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - └┬ Wildcard must be the last case - └─ Wildcard can't be the first case - -Next reachable case: -┌─⯈ tests/enum/bad/not_ending_wildcard.catala_en:20.5-20.18: -└──┐ -20 │ -- Case2 : 42 - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾ - └┬ Wildcard must be the last case - └─ Wildcard can't be the first case +┌─[ERROR]─ +│ +│ Wildcard must be the last match case +│ +│ Not ending wildcard: +├─➤ tests/enum/bad/not_ending_wildcard.catala_en:19.5-19.21: +│ │ +│ 19 │ -- anything : 31 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +├─ Wildcard must be the last case +│ └─ Wildcard can't be the first case +│ +│ Next reachable case: +├─➤ tests/enum/bad/not_ending_wildcard.catala_en:20.5-20.18: +│ │ +│ 20 │ -- Case2 : 42 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾ +└─ Wildcard must be the last case + └─ Wildcard can't be the first case #return code 123# ``` ```catala-test-inline $ catala test-scope Middle_case -[ERROR] Wildcard must be the last match case - -Not ending wildcard: -┌─⯈ tests/enum/bad/not_ending_wildcard.catala_en:19.5-19.21: -└──┐ -19 │ -- anything : 31 - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - └┬ Wildcard must be the last case - └─ Wildcard can't be the first case - -Next reachable case: -┌─⯈ tests/enum/bad/not_ending_wildcard.catala_en:20.5-20.18: -└──┐ -20 │ -- Case2 : 42 - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾ - └┬ Wildcard must be the last case - └─ Wildcard can't be the first case +┌─[ERROR]─ +│ +│ Wildcard must be the last match case +│ +│ Not ending wildcard: +├─➤ tests/enum/bad/not_ending_wildcard.catala_en:19.5-19.21: +│ │ +│ 19 │ -- anything : 31 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +├─ Wildcard must be the last case +│ └─ Wildcard can't be the first case +│ +│ Next reachable case: +├─➤ tests/enum/bad/not_ending_wildcard.catala_en:20.5-20.18: +│ │ +│ 20 │ -- Case2 : 42 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾ +└─ Wildcard must be the last case + └─ Wildcard can't be the first case #return code 123# ``` diff --git a/tests/enum/bad/quick_pattern_2.catala_en b/tests/enum/bad/quick_pattern_2.catala_en index a449b9135..0c5688a8c 100644 --- a/tests/enum/bad/quick_pattern_2.catala_en +++ b/tests/enum/bad/quick_pattern_2.catala_en @@ -30,29 +30,31 @@ scope B: ```catala-test-inline $ catala test-scope A -[ERROR] Error during typechecking, incompatible types: - ┌─⯈ E - └─⯈ F - -While typechecking the following expression: -┌─⯈ tests/enum/bad/quick_pattern_2.catala_en:28.23-28.24: -└──┐ -28 │ definition y equals x with pattern Case3 - │ ‾ - └─ Article - -Type E is coming from: -┌─⯈ tests/enum/bad/quick_pattern_2.catala_en:17.21-17.22: -└──┐ -17 │ context x content E - │ ‾ - └─ Article - -Type F is coming from: -┌─⯈ tests/enum/bad/quick_pattern_2.catala_en:28.23-28.43: -└──┐ -28 │ definition y equals x with pattern Case3 - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Article +┌─[ERROR]─ +│ +│ Error during typechecking, incompatible types: +│ ─➤ E +│ ─➤ F +│ +│ While typechecking the following expression: +├─➤ tests/enum/bad/quick_pattern_2.catala_en:28.23-28.24: +│ │ +│ 28 │ definition y equals x with pattern Case3 +│ │ ‾ +├─ Article +│ +│ Type E is coming from: +├─➤ tests/enum/bad/quick_pattern_2.catala_en:17.21-17.22: +│ │ +│ 17 │ context x content E +│ │ ‾ +├─ Article +│ +│ Type F is coming from: +├─➤ tests/enum/bad/quick_pattern_2.catala_en:28.23-28.43: +│ │ +│ 28 │ definition y equals x with pattern Case3 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +└─ Article #return code 123# ``` diff --git a/tests/enum/bad/quick_pattern_3.catala_en b/tests/enum/bad/quick_pattern_3.catala_en index 19fcbd3f9..d29211254 100644 --- a/tests/enum/bad/quick_pattern_3.catala_en +++ b/tests/enum/bad/quick_pattern_3.catala_en @@ -20,29 +20,31 @@ definition y equals x with pattern Case3 ```catala-test-inline $ catala test-scope A -[ERROR] Error during typechecking, incompatible types: - ┌─⯈ E - └─⯈ F - -While typechecking the following expression: -┌─⯈ tests/enum/bad/quick_pattern_3.catala_en:18.21-18.22: -└──┐ -18 │ definition y equals x with pattern Case3 - │ ‾ - └─ Article - -Type E is coming from: -┌─⯈ tests/enum/bad/quick_pattern_3.catala_en:13.19-13.20: -└──┐ -13 │ context x content E - │ ‾ - └─ Article - -Type F is coming from: -┌─⯈ tests/enum/bad/quick_pattern_3.catala_en:18.21-18.41: -└──┐ -18 │ definition y equals x with pattern Case3 - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Article +┌─[ERROR]─ +│ +│ Error during typechecking, incompatible types: +│ ─➤ E +│ ─➤ F +│ +│ While typechecking the following expression: +├─➤ tests/enum/bad/quick_pattern_3.catala_en:18.21-18.22: +│ │ +│ 18 │ definition y equals x with pattern Case3 +│ │ ‾ +├─ Article +│ +│ Type E is coming from: +├─➤ tests/enum/bad/quick_pattern_3.catala_en:13.19-13.20: +│ │ +│ 13 │ context x content E +│ │ ‾ +├─ Article +│ +│ Type F is coming from: +├─➤ tests/enum/bad/quick_pattern_3.catala_en:18.21-18.41: +│ │ +│ 18 │ definition y equals x with pattern Case3 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +└─ Article #return code 123# ``` diff --git a/tests/enum/bad/quick_pattern_4.catala_en b/tests/enum/bad/quick_pattern_4.catala_en index cf03f4cdb..2a51d9dc4 100644 --- a/tests/enum/bad/quick_pattern_4.catala_en +++ b/tests/enum/bad/quick_pattern_4.catala_en @@ -19,29 +19,31 @@ definition y equals x with pattern Case3 ```catala-test-inline $ catala test-scope A -[ERROR] Error during typechecking, incompatible types: - ┌─⯈ E - └─⯈ F - -While typechecking the following expression: -┌─⯈ tests/enum/bad/quick_pattern_4.catala_en:17.21-17.22: -└──┐ -17 │ definition y equals x with pattern Case3 - │ ‾ - └─ Test - -Type E is coming from: -┌─⯈ tests/enum/bad/quick_pattern_4.catala_en:12.19-12.20: -└──┐ -12 │ context x content E - │ ‾ - └─ Test - -Type F is coming from: -┌─⯈ tests/enum/bad/quick_pattern_4.catala_en:17.21-17.41: -└──┐ -17 │ definition y equals x with pattern Case3 - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Test +┌─[ERROR]─ +│ +│ Error during typechecking, incompatible types: +│ ─➤ E +│ ─➤ F +│ +│ While typechecking the following expression: +├─➤ tests/enum/bad/quick_pattern_4.catala_en:17.21-17.22: +│ │ +│ 17 │ definition y equals x with pattern Case3 +│ │ ‾ +├─ Test +│ +│ Type E is coming from: +├─➤ tests/enum/bad/quick_pattern_4.catala_en:12.19-12.20: +│ │ +│ 12 │ context x content E +│ │ ‾ +├─ Test +│ +│ Type F is coming from: +├─➤ tests/enum/bad/quick_pattern_4.catala_en:17.21-17.41: +│ │ +│ 17 │ definition y equals x with pattern Case3 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +└─ Test #return code 123# ``` diff --git a/tests/enum/bad/quick_pattern_fail.catala_en b/tests/enum/bad/quick_pattern_fail.catala_en index eb1e0df52..26259c605 100644 --- a/tests/enum/bad/quick_pattern_fail.catala_en +++ b/tests/enum/bad/quick_pattern_fail.catala_en @@ -17,17 +17,19 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] The name of this constructor has not been defined before - (it's probably a typographical error). - -Here is your code : -┌─⯈ tests/enum/bad/quick_pattern_fail.catala_en:15.38-15.43: -└──┐ -15 │ definition y equals x with pattern Case3 - │ ‾‾‾‾‾ - └─ Article - -Maybe you wanted to write : "Case1", -or "Case2" +┌─[ERROR]─ +│ +│ The name of this constructor has not been defined before +│ (it's probably a typographical error). +│ +│ Here is your code : +├─➤ tests/enum/bad/quick_pattern_fail.catala_en:15.38-15.43: +│ │ +│ 15 │ definition y equals x with pattern Case3 +│ │ ‾‾‾‾‾ +├─ Article +│ +│ Maybe you wanted to write : "Case1", or "Case2" ? +└─ #return code 123# ``` diff --git a/tests/enum/bad/too_many_cases.catala_en b/tests/enum/bad/too_many_cases.catala_en index b940d21c6..929f0fd6a 100644 --- a/tests/enum/bad/too_many_cases.catala_en +++ b/tests/enum/bad/too_many_cases.catala_en @@ -23,13 +23,15 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] This case matches a constructor of enumeration E but previous cases - were matching constructors of enumeration F - -┌─⯈ tests/enum/bad/too_many_cases.catala_en:21.8-21.13: -└──┐ -21 │ -- Case4 : true - │ ‾‾‾‾‾ - └─ Article +┌─[ERROR]─ +│ +│ This case matches a constructor of enumeration E but previous cases were +│ matching constructors of enumeration F +│ +├─➤ tests/enum/bad/too_many_cases.catala_en:21.8-21.13: +│ │ +│ 21 │ -- Case4 : true +│ │ ‾‾‾‾‾ +└─ Article #return code 123# ``` diff --git a/tests/enum/bad/useless_wildcard.catala_en b/tests/enum/bad/useless_wildcard.catala_en index 50a001ac2..2720fcf71 100644 --- a/tests/enum/bad/useless_wildcard.catala_en +++ b/tests/enum/bad/useless_wildcard.catala_en @@ -19,15 +19,18 @@ scope A: ```catala-test-inline $ catala test-scope A -[WARNING] Unreachable match case, all constructors of the enumeration E are - already specified - -┌─⯈ tests/enum/bad/useless_wildcard.catala_en:17.5-17.21: -└──┐ -17 │ -- anything : 31 - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Useless wildcard -[RESULT] Computation successful! Results: -[RESULT] x = Case1 () -[RESULT] y = 42 +┌─[WARNING]─ +│ +│ Unreachable match case, all constructors of the enumeration E are already +│ specified +│ +├─➤ tests/enum/bad/useless_wildcard.catala_en:17.5-17.21: +│ │ +│ 17 │ -- anything : 31 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +└─ Useless wildcard +┌─[RESULT]─ +│ x = Case1 () +│ y = 42 +└─ ``` diff --git a/tests/enum/bad/wrong_cons.catala_en b/tests/enum/bad/wrong_cons.catala_en index ee5d5abe2..7fde756ef 100644 --- a/tests/enum/bad/wrong_cons.catala_en +++ b/tests/enum/bad/wrong_cons.catala_en @@ -13,16 +13,19 @@ scope A: ```catala-test-inline $ catala Typecheck -[ERROR] The name of this constructor has not been defined before - (it's probably a typographical error). - -Here is your code : -┌─⯈ tests/enum/bad/wrong_cons.catala_en:11.23-11.28: -└──┐ -11 │ definition e equals Case2 - │ ‾‾‾‾‾ - └─ Article - -Maybe you wanted to write : "Case1" +┌─[ERROR]─ +│ +│ The name of this constructor has not been defined before +│ (it's probably a typographical error). +│ +│ Here is your code : +├─➤ tests/enum/bad/wrong_cons.catala_en:11.23-11.28: +│ │ +│ 11 │ definition e equals Case2 +│ │ ‾‾‾‾‾ +├─ Article +│ +│ Maybe you wanted to write : "Case1" ? +└─ #return code 123# ``` diff --git a/tests/enum/good/disambiguated_cases.catala_en b/tests/enum/good/disambiguated_cases.catala_en index 9ea9b469b..752ba1c4a 100644 --- a/tests/enum/good/disambiguated_cases.catala_en +++ b/tests/enum/good/disambiguated_cases.catala_en @@ -25,14 +25,19 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] e = Case1 () -[RESULT] f = Case1 2 -[RESULT] x = 2 +┌─[RESULT]─ +│ e = Case1 () +│ f = Case1 2 +│ x = 2 +└─ ``` diff --git a/tests/enum/good/quick_pattern_check.catala_en b/tests/enum/good/quick_pattern_check.catala_en index 7bb9d1b92..572a070b8 100644 --- a/tests/enum/good/quick_pattern_check.catala_en +++ b/tests/enum/good/quick_pattern_check.catala_en @@ -20,14 +20,19 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = Case1 2 -[RESULT] y = true -[RESULT] z = false +┌─[RESULT]─ +│ x = Case1 2 +│ y = true +│ z = false +└─ ``` diff --git a/tests/enum/good/simple.catala_en b/tests/enum/good/simple.catala_en index 567f60758..a9ce5a065 100644 --- a/tests/enum/good/simple.catala_en +++ b/tests/enum/good/simple.catala_en @@ -20,13 +20,18 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = Case1 2 -[RESULT] y = 42 +┌─[RESULT]─ +│ x = Case1 2 +│ y = 42 +└─ ``` diff --git a/tests/enum/good/wildcard.catala_en b/tests/enum/good/wildcard.catala_en index e34f47f51..65b66c42d 100644 --- a/tests/enum/good/wildcard.catala_en +++ b/tests/enum/good/wildcard.catala_en @@ -40,20 +40,26 @@ scope Simple_case_2: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope Simple_case_2 -[RESULT] Computation successful! Results: -[RESULT] x = Case3 () -[RESULT] y = 31 +┌─[RESULT]─ +│ x = Case3 () +│ y = 31 +└─ ``` ```catala-test-inline $ catala test-scope Simple_case -[RESULT] Computation successful! Results: -[RESULT] x = Case1 2 -[RESULT] y = 31 +┌─[RESULT]─ +│ x = Case1 2 +│ y = 31 +└─ ``` diff --git a/tests/exception/bad/ambiguous_unlabeled_exception.catala_en b/tests/exception/bad/ambiguous_unlabeled_exception.catala_en index 3a8f423b0..84df5c679 100644 --- a/tests/exception/bad/ambiguous_unlabeled_exception.catala_en +++ b/tests/exception/bad/ambiguous_unlabeled_exception.catala_en @@ -15,30 +15,32 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] This exception can refer to several definitions. Try using labels to - disambiguate - -Ambiguous exception -┌─⯈ tests/exception/bad/ambiguous_unlabeled_exception.catala_en:12.3-13.15: -└──┐ -12 │ exception - │ ‾‾‾‾‾‾‾‾‾ -13 │ definition x equals 2 - │ ‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Test - -Candidate definition -┌─⯈ tests/exception/bad/ambiguous_unlabeled_exception.catala_en:10.14-10.15: -└──┐ -10 │ definition x equals 1 - │ ‾ - └─ Test - -Candidate definition -┌─⯈ tests/exception/bad/ambiguous_unlabeled_exception.catala_en:8.14-8.15: -└─┐ -8 │ definition x equals 0 - │ ‾ - └─ Test +┌─[ERROR]─ +│ +│ This exception can refer to several definitions. Try using labels to +│ disambiguate +│ +│ Ambiguous exception +├─➤ tests/exception/bad/ambiguous_unlabeled_exception.catala_en:12.3-13.15: +│ │ +│ 12 │ exception +│ │ ‾‾‾‾‾‾‾‾‾ +│ 13 │ definition x equals 2 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾ +├─ Test +│ +│ Candidate definition +├─➤ tests/exception/bad/ambiguous_unlabeled_exception.catala_en:10.14-10.15: +│ │ +│ 10 │ definition x equals 1 +│ │ ‾ +├─ Test +│ +│ Candidate definition +├─➤ tests/exception/bad/ambiguous_unlabeled_exception.catala_en:8.14-8.15: +│ │ +│ 8 │ definition x equals 0 +│ │ ‾ +└─ Test #return code 123# ``` diff --git a/tests/exception/bad/dangling_exception.catala_en b/tests/exception/bad/dangling_exception.catala_en index 1ca7483bd..1a0b423f4 100644 --- a/tests/exception/bad/dangling_exception.catala_en +++ b/tests/exception/bad/dangling_exception.catala_en @@ -15,12 +15,14 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] Unknown label for the scope variable x: "base_y" - -┌─⯈ tests/exception/bad/dangling_exception.catala_en:12.13-12.19: -└──┐ -12 │ exception base_y - │ ‾‾‾‾‾‾ - └─ Test +┌─[ERROR]─ +│ +│ Unknown label for the scope variable x: "base_y" +│ +├─➤ tests/exception/bad/dangling_exception.catala_en:12.13-12.19: +│ │ +│ 12 │ exception base_y +│ │ ‾‾‾‾‾‾ +└─ Test #return code 123# ``` diff --git a/tests/exception/bad/exceptions_cycle.catala_en b/tests/exception/bad/exceptions_cycle.catala_en index 3cb3d7581..66404e024 100644 --- a/tests/exception/bad/exceptions_cycle.catala_en +++ b/tests/exception/bad/exceptions_cycle.catala_en @@ -20,35 +20,38 @@ scope A: ```catala-test-inline $ catala test-scope 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/exception/bad/exceptions_cycle.catala_en:8.3-10.15: -└──┐ - 8 │ label base_x - │ ‾‾‾‾‾‾‾‾‾‾‾‾ - 9 │ exception exception_exception_x - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -10 │ definition x equals 0 - │ ‾‾‾‾‾‾‾‾‾‾‾‾ - -┌─⯈ tests/exception/bad/exceptions_cycle.catala_en:12.3-14.15: -└──┐ -12 │ label exception_x - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -13 │ exception base_x - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -14 │ definition x equals 1 - │ ‾‾‾‾‾‾‾‾‾‾‾‾ - -┌─⯈ tests/exception/bad/exceptions_cycle.catala_en:16.3-18.15: -└──┐ -16 │ label exception_exception_x - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -17 │ exception exception_x - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -18 │ definition x equals 2 - │ ‾‾‾‾‾‾‾‾‾‾‾‾ +┌─[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/exception/bad/exceptions_cycle.catala_en:8.3-10.15: +│ │ +│ 8 │ label base_x +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾ +│ 9 │ exception exception_exception_x +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +│ 10 │ definition x equals 0 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾ +│ +├─➤ tests/exception/bad/exceptions_cycle.catala_en:12.3-14.15: +│ │ +│ 12 │ label exception_x +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +│ 13 │ exception base_x +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +│ 14 │ definition x equals 1 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾ +│ +├─➤ tests/exception/bad/exceptions_cycle.catala_en:16.3-18.15: +│ │ +│ 16 │ label exception_exception_x +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +│ 17 │ exception exception_x +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +│ 18 │ definition x equals 2 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾ +└─ #return code 123# ``` diff --git a/tests/exception/bad/missing_unlabeled_definition.catala_en b/tests/exception/bad/missing_unlabeled_definition.catala_en index fd9159ea7..98ba6a050 100644 --- a/tests/exception/bad/missing_unlabeled_definition.catala_en +++ b/tests/exception/bad/missing_unlabeled_definition.catala_en @@ -11,14 +11,16 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] This exception does not have a corresponding definition - -┌─⯈ tests/exception/bad/missing_unlabeled_definition.catala_en:8.3-9.15: -└─┐ -8 │ exception - │ ‾‾‾‾‾‾‾‾‾ -9 │ definition x equals 1 - │ ‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Test +┌─[ERROR]─ +│ +│ This exception does not have a corresponding definition +│ +├─➤ tests/exception/bad/missing_unlabeled_definition.catala_en:8.3-9.15: +│ │ +│ 8 │ exception +│ │ ‾‾‾‾‾‾‾‾‾ +│ 9 │ definition x equals 1 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾ +└─ Test #return code 123# ``` diff --git a/tests/exception/bad/one_ambiguous_exception.catala_en b/tests/exception/bad/one_ambiguous_exception.catala_en index 868db4697..15d344a43 100644 --- a/tests/exception/bad/one_ambiguous_exception.catala_en +++ b/tests/exception/bad/one_ambiguous_exception.catala_en @@ -21,30 +21,32 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] This exception can refer to several definitions. Try using labels to - disambiguate - -Ambiguous exception -┌─⯈ tests/exception/bad/one_ambiguous_exception.catala_en:18.3-19.15: -└──┐ -18 │ exception - │ ‾‾‾‾‾‾‾‾‾ -19 │ definition y equals 3 - │ ‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Test - -Candidate definition -┌─⯈ tests/exception/bad/one_ambiguous_exception.catala_en:16.14-16.15: -└──┐ -16 │ definition y equals 4 - │ ‾ - └─ Test - -Candidate definition -┌─⯈ tests/exception/bad/one_ambiguous_exception.catala_en:14.14-14.15: -└──┐ -14 │ definition y equals 2 - │ ‾ - └─ Test +┌─[ERROR]─ +│ +│ This exception can refer to several definitions. Try using labels to +│ disambiguate +│ +│ Ambiguous exception +├─➤ tests/exception/bad/one_ambiguous_exception.catala_en:18.3-19.15: +│ │ +│ 18 │ exception +│ │ ‾‾‾‾‾‾‾‾‾ +│ 19 │ definition y equals 3 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾ +├─ Test +│ +│ Candidate definition +├─➤ tests/exception/bad/one_ambiguous_exception.catala_en:16.14-16.15: +│ │ +│ 16 │ definition y equals 4 +│ │ ‾ +├─ Test +│ +│ Candidate definition +├─➤ tests/exception/bad/one_ambiguous_exception.catala_en:14.14-14.15: +│ │ +│ 14 │ definition y equals 2 +│ │ ‾ +└─ Test #return code 123# ``` diff --git a/tests/exception/bad/self_exception.catala_en b/tests/exception/bad/self_exception.catala_en index b3eb556ec..219dc87d2 100644 --- a/tests/exception/bad/self_exception.catala_en +++ b/tests/exception/bad/self_exception.catala_en @@ -12,12 +12,14 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] Cannot define rule as an exception to itself - -┌─⯈ tests/exception/bad/self_exception.catala_en:9.13-9.19: -└─┐ -9 │ exception base_y - │ ‾‾‾‾‾‾ - └─ Test +┌─[ERROR]─ +│ +│ Cannot define rule as an exception to itself +│ +├─➤ tests/exception/bad/self_exception.catala_en:9.13-9.19: +│ │ +│ 9 │ exception base_y +│ │ ‾‾‾‾‾‾ +└─ Test #return code 123# ``` diff --git a/tests/exception/bad/two_exceptions.catala_en b/tests/exception/bad/two_exceptions.catala_en index 04231252a..610090e4c 100644 --- a/tests/exception/bad/two_exceptions.catala_en +++ b/tests/exception/bad/two_exceptions.catala_en @@ -17,19 +17,21 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] During evaluation: conflict between multiple valid consequences for - assigning the same variable. - -┌─⯈ tests/exception/bad/two_exceptions.catala_en:12.23-12.24: -└──┐ -12 │ definition x equals 1 - │ ‾ - └─ Test - -┌─⯈ tests/exception/bad/two_exceptions.catala_en:15.23-15.24: -└──┐ -15 │ definition x equals 2 - │ ‾ - └─ Test +┌─[ERROR]─ +│ +│ During evaluation: conflict between multiple valid consequences for +│ assigning the same variable. +│ +├─➤ tests/exception/bad/two_exceptions.catala_en:12.23-12.24: +│ │ +│ 12 │ definition x equals 1 +│ │ ‾ +├─ Test +│ +├─➤ tests/exception/bad/two_exceptions.catala_en:15.23-15.24: +│ │ +│ 15 │ definition x equals 2 +│ │ ‾ +└─ Test #return code 123# ``` diff --git a/tests/exception/good/context_with_default.catala_en b/tests/exception/good/context_with_default.catala_en index 9c7d4a0ea..65f5af60c 100644 --- a/tests/exception/good/context_with_default.catala_en +++ b/tests/exception/good/context_with_default.catala_en @@ -19,11 +19,17 @@ scope Bar: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope Bar -[RESULT] Computation successful! +┌─[RESULT]─ +│ Computation successful! +└─ ``` diff --git a/tests/exception/good/double_definition.catala_en b/tests/exception/good/double_definition.catala_en index 94f5f5328..5f4a95ed6 100644 --- a/tests/exception/good/double_definition.catala_en +++ b/tests/exception/good/double_definition.catala_en @@ -14,40 +14,48 @@ scope Foo: ```catala-test-inline $ catala Typecheck --check-invariants -[WARNING] These definitions have identical justifications and consequences; - is it a mistake? - -┌─⯈ tests/exception/good/double_definition.catala_en:9.3-9.15: -└─┐ -9 │ definition x equals 1 - │ ‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Foo - -┌─⯈ tests/exception/good/double_definition.catala_en:8.3-8.15: -└─┐ -8 │ definition x equals 1 - │ ‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Foo -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[WARNING]─ +│ +│ These definitions have identical justifications and consequences; +│ is it a mistake? +│ +├─➤ tests/exception/good/double_definition.catala_en:9.3-9.15: +│ │ +│ 9 │ definition x equals 1 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾ +├─ Foo +│ +├─➤ tests/exception/good/double_definition.catala_en:8.3-8.15: +│ │ +│ 8 │ definition x equals 1 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾ +└─ Foo +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Scopelang -s Foo -[WARNING] These definitions have identical justifications and consequences; - is it a mistake? - -┌─⯈ tests/exception/good/double_definition.catala_en:9.3-9.15: -└─┐ -9 │ definition x equals 1 - │ ‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Foo - -┌─⯈ tests/exception/good/double_definition.catala_en:8.3-8.15: -└─┐ -8 │ definition x equals 1 - │ ‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Foo +┌─[WARNING]─ +│ +│ These definitions have identical justifications and consequences; +│ is it a mistake? +│ +├─➤ tests/exception/good/double_definition.catala_en:9.3-9.15: +│ │ +│ 9 │ definition x equals 1 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾ +├─ Foo +│ +├─➤ tests/exception/good/double_definition.catala_en:8.3-8.15: +│ │ +│ 8 │ definition x equals 1 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾ +└─ Foo let scope Foo (x: integer|internal|output) = let x : integer = error_empty ⟨ ⟨true ⊢ ⟨1⟩⟩, ⟨true ⊢ ⟨1⟩⟩ | false ⊢ ∅ ⟩ ``` @@ -60,20 +68,22 @@ Dcalc translation below. ```catala-test-inline $ catala Dcalc -s Foo -[WARNING] These definitions have identical justifications and consequences; - is it a mistake? - -┌─⯈ tests/exception/good/double_definition.catala_en:9.3-9.15: -└─┐ -9 │ definition x equals 1 - │ ‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Foo - -┌─⯈ tests/exception/good/double_definition.catala_en:8.3-8.15: -└─┐ -8 │ definition x equals 1 - │ ‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Foo +┌─[WARNING]─ +│ +│ These definitions have identical justifications and consequences; +│ is it a mistake? +│ +├─➤ tests/exception/good/double_definition.catala_en:9.3-9.15: +│ │ +│ 9 │ definition x equals 1 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾ +├─ Foo +│ +├─➤ tests/exception/good/double_definition.catala_en:8.3-8.15: +│ │ +│ 8 │ definition x equals 1 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾ +└─ Foo let scope Foo (Foo_in: Foo_in): Foo {x: integer} = let set x : integer = error_empty ⟨ ⟨ ⟨true ⊢ ⟨1⟩⟩ | true ⊢ ⟨1⟩ ⟩ | false ⊢ ∅ ⟩ diff --git a/tests/exception/good/duplicate_labels.catala_en b/tests/exception/good/duplicate_labels.catala_en index 86aacaa66..44e6caf28 100644 --- a/tests/exception/good/duplicate_labels.catala_en +++ b/tests/exception/good/duplicate_labels.catala_en @@ -22,13 +22,18 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = 0 -[RESULT] y = 0 +┌─[RESULT]─ +│ x = 0 +│ y = 0 +└─ ``` diff --git a/tests/exception/good/exception.catala_en b/tests/exception/good/exception.catala_en index f048c4828..e834e455b 100644 --- a/tests/exception/good/exception.catala_en +++ b/tests/exception/good/exception.catala_en @@ -16,12 +16,17 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = 1 +┌─[RESULT]─ +│ x = 1 +└─ ``` diff --git a/tests/exception/good/exceptions_squared.catala_en b/tests/exception/good/exceptions_squared.catala_en index de40a2798..76ba6aa7e 100644 --- a/tests/exception/good/exceptions_squared.catala_en +++ b/tests/exception/good/exceptions_squared.catala_en @@ -20,12 +20,17 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = 2 +┌─[RESULT]─ +│ x = 2 +└─ ``` diff --git a/tests/exception/good/grouped_exceptions.catala_en b/tests/exception/good/grouped_exceptions.catala_en index daafce276..0b3152df9 100644 --- a/tests/exception/good/grouped_exceptions.catala_en +++ b/tests/exception/good/grouped_exceptions.catala_en @@ -50,13 +50,18 @@ scope Benefit: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope Benefit -[RESULT] Computation successful! Results: -[RESULT] benefit = $2,000.00 -[RESULT] person = Person { -- age: 26 -- disabled: true } +┌─[RESULT]─ +│ benefit = $2,000.00 +│ person = Person { -- age: 26 -- disabled: true } +└─ ``` diff --git a/tests/exception/good/groups_of_exceptions.catala_en b/tests/exception/good/groups_of_exceptions.catala_en index 7617d4792..bbfea442b 100644 --- a/tests/exception/good/groups_of_exceptions.catala_en +++ b/tests/exception/good/groups_of_exceptions.catala_en @@ -44,14 +44,19 @@ scope Test: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope Test -[RESULT] Computation successful! Results: -[RESULT] x = 2 +┌─[RESULT]─ +│ x = 2 +└─ ``` @@ -80,46 +85,54 @@ let scope Test (x: integer|internal|output) (f: Foo {x: integer}|internal) = ```catala-test-inline $ catala Exceptions -s Foo -v x -[RESULT] -Printing the tree of exceptions for the definitions of variable "x" of scope "Foo". -[RESULT] -Definitions with label "base": -┌─⯈ tests/exception/good/groups_of_exceptions.catala_en:9.3-9.26: -└─┐ -9 │ label base definition x under condition - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Test -┌─⯈ tests/exception/good/groups_of_exceptions.catala_en:13.3-13.26: -└──┐ -13 │ label base definition x under condition - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Test -[RESULT] -Definitions with label "intermediate": -┌─⯈ tests/exception/good/groups_of_exceptions.catala_en:17.3-17.49: -└──┐ -17 │ label intermediate exception base definition x under condition - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Test -┌─⯈ tests/exception/good/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/exception/good/groups_of_exceptions.catala_en:25.3-25.38: -└──┐ -25 │ exception intermediate definition x under condition - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Test -┌─⯈ tests/exception/good/groups_of_exceptions.catala_en:29.3-29.38: -└──┐ -29 │ exception intermediate definition x under condition - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Test -[RESULT] -The exception tree structure is as follows: - -"base"───"intermediate"───"exception_to_intermediate" +┌─[RESULT]─ +│ Printing the tree of exceptions for the definitions of variable "x" of scope "Foo". +└─ +┌─[RESULT]─ +│ Definitions with label "base": +│ +├─➤ tests/exception/good/groups_of_exceptions.catala_en:9.3-9.26: +│ │ +│ 9 │ label base definition x under condition +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +├─ Test +│ +├─➤ tests/exception/good/groups_of_exceptions.catala_en:13.3-13.26: +│ │ +│ 13 │ label base definition x under condition +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +└─ Test +┌─[RESULT]─ +│ Definitions with label "intermediate": +│ +├─➤ tests/exception/good/groups_of_exceptions.catala_en:17.3-17.49: +│ │ +│ 17 │ label intermediate exception base definition x under condition +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +├─ Test +│ +├─➤ tests/exception/good/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/exception/good/groups_of_exceptions.catala_en:25.3-25.38: +│ │ +│ 25 │ exception intermediate definition x under condition +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +├─ Test +│ +├─➤ tests/exception/good/groups_of_exceptions.catala_en:29.3-29.38: +│ │ +│ 29 │ exception intermediate definition x under condition +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +└─ Test +┌─[RESULT]─ +│ The exception tree structure is as follows: +│ +│ "base"───"intermediate"───"exception_to_intermediate" +└─ ``` diff --git a/tests/exception/good/same_label_two_variables.catala_en b/tests/exception/good/same_label_two_variables.catala_en index 39127e442..f032d4aa1 100644 --- a/tests/exception/good/same_label_two_variables.catala_en +++ b/tests/exception/good/same_label_two_variables.catala_en @@ -23,14 +23,19 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = 0 -[RESULT] y = 1 -[RESULT] z = 0 +┌─[RESULT]─ +│ x = 0 +│ y = 1 +│ z = 0 +└─ ``` diff --git a/tests/exception/good/split_unlabeled_exception.catala_en b/tests/exception/good/split_unlabeled_exception.catala_en index 0c8cb118b..d02d206a1 100644 --- a/tests/exception/good/split_unlabeled_exception.catala_en +++ b/tests/exception/good/split_unlabeled_exception.catala_en @@ -18,12 +18,17 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = 1 +┌─[RESULT]─ +│ x = 1 +└─ ``` diff --git a/tests/exception/good/two_exceptions_same_outcome.catala_en b/tests/exception/good/two_exceptions_same_outcome.catala_en index a596bba2f..cf024f5db 100644 --- a/tests/exception/good/two_exceptions_same_outcome.catala_en +++ b/tests/exception/good/two_exceptions_same_outcome.catala_en @@ -24,12 +24,17 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = 0 +┌─[RESULT]─ +│ x = 0 +└─ ``` diff --git a/tests/exception/good/two_unlabeled_exceptions.catala_en b/tests/exception/good/two_unlabeled_exceptions.catala_en index 7a76bfc94..ed97482f1 100644 --- a/tests/exception/good/two_unlabeled_exceptions.catala_en +++ b/tests/exception/good/two_unlabeled_exceptions.catala_en @@ -21,13 +21,18 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = 1 -[RESULT] y = 3 +┌─[RESULT]─ +│ x = 1 +│ y = 3 +└─ ``` diff --git a/tests/exception/good/unlabeled_exception.catala_en b/tests/exception/good/unlabeled_exception.catala_en index 9fa0e0bb3..8c9021cb0 100644 --- a/tests/exception/good/unlabeled_exception.catala_en +++ b/tests/exception/good/unlabeled_exception.catala_en @@ -15,12 +15,17 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = 1 +┌─[RESULT]─ +│ x = 1 +└─ ``` diff --git a/tests/exception/good/unsorted_unlabeled_exceptions.catala_en b/tests/exception/good/unsorted_unlabeled_exceptions.catala_en index 28a06846c..dacafc9a5 100644 --- a/tests/exception/good/unsorted_unlabeled_exceptions.catala_en +++ b/tests/exception/good/unsorted_unlabeled_exceptions.catala_en @@ -21,13 +21,18 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = 1 -[RESULT] y = 2 +┌─[RESULT]─ +│ x = 1 +│ y = 2 +└─ ``` diff --git a/tests/func/bad/bad_func.catala_en b/tests/func/bad/bad_func.catala_en index 51ab0729b..c7faf8f3e 100644 --- a/tests/func/bad/bad_func.catala_en +++ b/tests/func/bad/bad_func.catala_en @@ -23,25 +23,28 @@ scope R: ```catala-test-inline $ catala test-scope R -[RESULT] Computation successful! Results: -[RESULT] r = 30 +┌─[RESULT]─ +│ r = 30 +└─ ``` ```catala-test-inline $ catala test-scope S -[ERROR] During evaluation: conflict between multiple valid consequences for - assigning the same variable. - -┌─⯈ tests/func/bad/bad_func.catala_en:14.65-14.70: -└──┐ -14 │ definition f of x under condition (x >= x) consequence equals x + x - │ ‾‾‾‾‾ - └─ Article - -┌─⯈ tests/func/bad/bad_func.catala_en:15.62-15.67: -└──┐ -15 │ definition f of x under condition not b consequence equals x * x - │ ‾‾‾‾‾ - └─ Article +┌─[ERROR]─ +│ +│ During evaluation: conflict between multiple valid consequences for +│ assigning the same variable. +│ +├─➤ tests/func/bad/bad_func.catala_en:14.65-14.70: +│ │ +│ 14 │ definition f of x under condition (x >= x) consequence equals x + x +│ │ ‾‾‾‾‾ +├─ Article +│ +├─➤ tests/func/bad/bad_func.catala_en:15.62-15.67: +│ │ +│ 15 │ definition f of x under condition not b consequence equals x * x +│ │ ‾‾‾‾‾ +└─ Article #return code 123# ``` diff --git a/tests/func/bad/param_inconsistency.catala_en b/tests/func/bad/param_inconsistency.catala_en index 707ba3e63..d2706319e 100644 --- a/tests/func/bad/param_inconsistency.catala_en +++ b/tests/func/bad/param_inconsistency.catala_en @@ -14,19 +14,22 @@ scope S: ```catala-test-inline $ catala typecheck -[ERROR] Function argument name mismatch between declaration ('x') and - definition ('y') - -Argument declared here: -┌─⯈ tests/func/bad/param_inconsistency.catala_en:4.42-4.43: -└─┐ -4 │ internal f1 content decimal depends on x content integer - │ ‾ - -Defined here: -┌─⯈ tests/func/bad/param_inconsistency.catala_en:10.20-10.21: -└──┐ -10 │ definition f1 of y under condition not cond - │ ‾ +┌─[ERROR]─ +│ +│ Function argument name mismatch between declaration ('x') and definition +│ ('y') +│ +│ Argument declared here: +├─➤ tests/func/bad/param_inconsistency.catala_en:4.42-4.43: +│ │ +│ 4 │ internal f1 content decimal depends on x content integer +│ │ ‾ +│ +│ Defined here: +├─➤ tests/func/bad/param_inconsistency.catala_en:10.20-10.21: +│ │ +│ 10 │ definition f1 of y under condition not cond +│ │ ‾ +└─ #return code 123# ``` diff --git a/tests/func/bad/param_inconsistency2.catala_en b/tests/func/bad/param_inconsistency2.catala_en index 60875e2a2..cecb15027 100644 --- a/tests/func/bad/param_inconsistency2.catala_en +++ b/tests/func/bad/param_inconsistency2.catala_en @@ -13,19 +13,22 @@ scope S: ```catala-test-inline $ catala typecheck -[ERROR] Function argument name mismatch between declaration ('x') and - definition ('y') - -Argument declared here: -┌─⯈ tests/func/bad/param_inconsistency2.catala_en:4.42-4.43: -└─┐ -4 │ internal f1 content decimal depends on x content integer - │ ‾ - -Defined here: -┌─⯈ tests/func/bad/param_inconsistency2.catala_en:9.30-9.31: -└─┐ -9 │ exception definition f1 of y under condition not cond - │ ‾ +┌─[ERROR]─ +│ +│ Function argument name mismatch between declaration ('x') and definition +│ ('y') +│ +│ Argument declared here: +├─➤ tests/func/bad/param_inconsistency2.catala_en:4.42-4.43: +│ │ +│ 4 │ internal f1 content decimal depends on x content integer +│ │ ‾ +│ +│ Defined here: +├─➤ tests/func/bad/param_inconsistency2.catala_en:9.30-9.31: +│ │ +│ 9 │ exception definition f1 of y under condition not cond +│ │ ‾ +└─ #return code 123# ``` diff --git a/tests/func/bad/param_inconsistency3.catala_en b/tests/func/bad/param_inconsistency3.catala_en index 8d29d9750..06411cd5a 100644 --- a/tests/func/bad/param_inconsistency3.catala_en +++ b/tests/func/bad/param_inconsistency3.catala_en @@ -13,19 +13,22 @@ scope S: ```catala-test-inline $ catala typecheck -[ERROR] Function argument name mismatch between declaration ('x') and - definition ('y') - -Argument declared here: -┌─⯈ tests/func/bad/param_inconsistency3.catala_en:4.42-4.43: -└─┐ -4 │ internal f1 content decimal depends on x content integer - │ ‾ - -Defined here: -┌─⯈ tests/func/bad/param_inconsistency3.catala_en:9.30-9.31: -└─┐ -9 │ exception definition f1 of y under condition not cond - │ ‾ +┌─[ERROR]─ +│ +│ Function argument name mismatch between declaration ('x') and definition +│ ('y') +│ +│ Argument declared here: +├─➤ tests/func/bad/param_inconsistency3.catala_en:4.42-4.43: +│ │ +│ 4 │ internal f1 content decimal depends on x content integer +│ │ ‾ +│ +│ Defined here: +├─➤ tests/func/bad/param_inconsistency3.catala_en:9.30-9.31: +│ │ +│ 9 │ exception definition f1 of y under condition not cond +│ │ ‾ +└─ #return code 123# ``` diff --git a/tests/func/bad/recursive.catala_en b/tests/func/bad/recursive.catala_en index cd2f0444a..48b059de6 100644 --- a/tests/func/bad/recursive.catala_en +++ b/tests/func/bad/recursive.catala_en @@ -10,13 +10,15 @@ scope RecursiveFunc: ```catala-test-inline $ catala test-scope RecursiveFunc -[ERROR] The variable f is used in one of its definitions - (Catala doesn't support recursion) - -┌─⯈ tests/func/bad/recursive.catala_en:8.28-8.29: -└─┐ -8 │ definition f of x equals f of x + 1 - │ ‾ - └─ Article +┌─[ERROR]─ +│ +│ The variable f is used in one of its definitions +│ (Catala doesn't support recursion) +│ +├─➤ tests/func/bad/recursive.catala_en:8.28-8.29: +│ │ +│ 8 │ definition f of x equals f of x + 1 +│ │ ‾ +└─ Article #return code 123# ``` diff --git a/tests/func/good/closure_conversion.catala_en b/tests/func/good/closure_conversion.catala_en index b84ea9b81..63c85e56b 100644 --- a/tests/func/good/closure_conversion.catala_en +++ b/tests/func/good/closure_conversion.catala_en @@ -15,8 +15,12 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline diff --git a/tests/func/good/closure_conversion_reduce.catala_en b/tests/func/good/closure_conversion_reduce.catala_en index 74adfd012..707457625 100644 --- a/tests/func/good/closure_conversion_reduce.catala_en +++ b/tests/func/good/closure_conversion_reduce.catala_en @@ -15,8 +15,12 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline diff --git a/tests/func/good/closure_return.catala_en b/tests/func/good/closure_return.catala_en index c0e483bb1..a43d86ffa 100644 --- a/tests/func/good/closure_return.catala_en +++ b/tests/func/good/closure_return.catala_en @@ -13,8 +13,12 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline diff --git a/tests/func/good/closure_through_scope.catala_en b/tests/func/good/closure_through_scope.catala_en index 170a6ffa3..b38c69bd6 100644 --- a/tests/func/good/closure_through_scope.catala_en +++ b/tests/func/good/closure_through_scope.catala_en @@ -21,8 +21,12 @@ scope T: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline @@ -42,6 +46,7 @@ let scope T (T_in: T_in): T {y: integer} = ```catala-test-inline $ catala Interpret --lcalc -s T --avoid-exceptions -O --closure-conversion -[RESULT] Computation successful! Results: -[RESULT] y = -2 +┌─[RESULT]─ +│ y = -2 +└─ ``` diff --git a/tests/func/good/context_func.catala_en b/tests/func/good/context_func.catala_en index a04517bc4..22c5911b4 100644 --- a/tests/func/good/context_func.catala_en +++ b/tests/func/good/context_func.catala_en @@ -19,28 +19,36 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[WARNING] Unused varible: a does not contribute to computing any of scope B - outputs. Did you forget something? - -┌─⯈ tests/func/good/context_func.catala_en:9.3-9.4: -└─┐ -9 │ a scope A - │ ‾ - └─ Test -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[WARNING]─ +│ +│ Unused varible: a does not contribute to computing any of scope B outputs. +│ Did you forget something? +│ +├─➤ tests/func/good/context_func.catala_en:9.3-9.4: +│ │ +│ 9 │ a scope A +│ │ ‾ +└─ Test +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Scopelang -s B -[WARNING] Unused varible: a does not contribute to computing any of scope B - outputs. Did you forget something? - -┌─⯈ tests/func/good/context_func.catala_en:9.3-9.4: -└─┐ -9 │ a scope A - │ ‾ - └─ Test +┌─[WARNING]─ +│ +│ Unused varible: a does not contribute to computing any of scope B outputs. +│ Did you forget something? +│ +├─➤ tests/func/good/context_func.catala_en:9.3-9.4: +│ │ +│ 9 │ a scope A +│ │ ‾ +└─ Test let scope B (b: bool|input) (a: A {f: integer → integer}|internal) = let a : A {f: integer → integer} = A of {"f"= (λ (x: integer) → ⟨ ⟨b && x > 0 ⊢ ⟨x - 1⟩⟩ | false ⊢ ∅ ⟩)} @@ -48,14 +56,16 @@ let scope B (b: bool|input) (a: A {f: integer → integer}|internal) = ```catala-test-inline $ catala Dcalc -s A -[WARNING] Unused varible: a does not contribute to computing any of scope B - outputs. Did you forget something? - -┌─⯈ tests/func/good/context_func.catala_en:9.3-9.4: -└─┐ -9 │ a scope A - │ ‾ - └─ Test +┌─[WARNING]─ +│ +│ Unused varible: a does not contribute to computing any of scope B outputs. +│ Did you forget something? +│ +├─➤ tests/func/good/context_func.catala_en:9.3-9.4: +│ │ +│ 9 │ a scope A +│ │ ‾ +└─ Test let scope A (A_in: A_in {f_in: integer → ⟨integer⟩}) : A {f: integer → integer} @@ -71,14 +81,16 @@ let scope A ```catala-test-inline $ catala Dcalc -s B -[WARNING] Unused varible: a does not contribute to computing any of scope B - outputs. Did you forget something? - -┌─⯈ tests/func/good/context_func.catala_en:9.3-9.4: -└─┐ -9 │ a scope A - │ ‾ - └─ Test +┌─[WARNING]─ +│ +│ Unused varible: a does not contribute to computing any of scope B outputs. +│ Did you forget something? +│ +├─➤ tests/func/good/context_func.catala_en:9.3-9.4: +│ │ +│ 9 │ a scope A +│ │ ‾ +└─ Test let scope B (B_in: B_in {b_in: bool}): B = let get b : bool = B_in.b_in in let set a : A {f: integer → integer} = diff --git a/tests/func/good/func.catala_en b/tests/func/good/func.catala_en index 805754e8c..2e2721b28 100644 --- a/tests/func/good/func.catala_en +++ b/tests/func/good/func.catala_en @@ -25,12 +25,17 @@ scope R: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope R -[RESULT] Computation successful! Results: -[RESULT] r = 30 +┌─[RESULT]─ +│ r = 30 +└─ ``` diff --git a/tests/func/good/param_consistency.catala_en b/tests/func/good/param_consistency.catala_en index 51a39b2fe..81df0ab06 100644 --- a/tests/func/good/param_consistency.catala_en +++ b/tests/func/good/param_consistency.catala_en @@ -16,13 +16,19 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala typecheck -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala @@ -41,9 +47,10 @@ scope T1: ```catala-test-inline $ catala test-scope T1 -[RESULT] Computation successful! Results: -[RESULT] o1 = 20.0 -[RESULT] o2 = 5.0 +┌─[RESULT]─ +│ o1 = 20.0 +│ o2 = 5.0 +└─ ``` ## Multi-argument function @@ -67,6 +74,7 @@ scope T2: ```catala-test-inline $ catala test-scope T2 -[RESULT] Computation successful! Results: -[RESULT] o = 40.0 +┌─[RESULT]─ +│ o = 40.0 +└─ ``` diff --git a/tests/func/good/scope_call_func_struct_closure.catala_en b/tests/func/good/scope_call_func_struct_closure.catala_en index 0236d836e..83399305c 100644 --- a/tests/func/good/scope_call_func_struct_closure.catala_en +++ b/tests/func/good/scope_call_func_struct_closure.catala_en @@ -44,8 +44,12 @@ two closures in Foo.r are different even with optimizations enabled. ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline @@ -159,6 +163,7 @@ let scope Foo ```catala-test-inline $ catala Interpret --lcalc -s Foo --avoid-exceptions -O --closure-conversion -[RESULT] Computation successful! Results: -[RESULT] z = 11 +┌─[RESULT]─ +│ z = 11 +└─ ``` diff --git a/tests/io/bad/forgot_input.catala_en b/tests/io/bad/forgot_input.catala_en index 97b5d8aa0..58176d8b2 100644 --- a/tests/io/bad/forgot_input.catala_en +++ b/tests/io/bad/forgot_input.catala_en @@ -16,21 +16,22 @@ scope B: ``` ```catala-test-inline $ catala Typecheck -[ERROR] This subscope variable is a mandatory input but no definition was - provided. - -Incriminated subscope: -┌─⯈ tests/io/bad/forgot_input.catala_en:9.3-9.4: -└─┐ -9 │ a scope A - │ ‾ - └─ Test - -Incriminated variable: -┌─⯈ tests/io/bad/forgot_input.catala_en:6.9-6.10: -└─┐ -6 │ input x content integer - │ ‾ - └─ Test +┌─[ERROR]─ +│ +│ This subscope variable is a mandatory input but no definition was provided. +│ +│ Incriminated subscope: +├─➤ tests/io/bad/forgot_input.catala_en:9.3-9.4: +│ │ +│ 9 │ a scope A +│ │ ‾ +├─ Test +│ +│ Incriminated variable: +├─➤ tests/io/bad/forgot_input.catala_en:6.9-6.10: +│ │ +│ 6 │ input x content integer +│ │ ‾ +└─ Test #return code 123# ``` diff --git a/tests/io/bad/inputing_to_not_input.catala_en b/tests/io/bad/inputing_to_not_input.catala_en index 357d3a9a1..7b636acee 100644 --- a/tests/io/bad/inputing_to_not_input.catala_en +++ b/tests/io/bad/inputing_to_not_input.catala_en @@ -16,27 +16,30 @@ scope B: ``` ```catala-test-inline $ catala Typecheck -[ERROR] Invalid assignment to a subscope variable that is not tagged as input - or context. - -Incriminated subscope: -┌─⯈ tests/io/bad/inputing_to_not_input.catala_en:8.3-8.4: -└─┐ -8 │ a scope A - │ ‾ - └─ Test - -Incriminated variable: -┌─⯈ tests/io/bad/inputing_to_not_input.catala_en:5.10-5.11: -└─┐ -5 │ output a content integer - │ ‾ - └─ Test - -Incriminated subscope variable definition: -┌─⯈ tests/io/bad/inputing_to_not_input.catala_en:14.3-14.17: -└──┐ -14 │ definition a.a equals 0 - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +┌─[ERROR]─ +│ +│ Invalid assignment to a subscope variable that is not tagged as input or +│ context. +│ +│ Incriminated subscope: +├─➤ tests/io/bad/inputing_to_not_input.catala_en:8.3-8.4: +│ │ +│ 8 │ a scope A +│ │ ‾ +├─ Test +│ +│ Incriminated variable: +├─➤ tests/io/bad/inputing_to_not_input.catala_en:5.10-5.11: +│ │ +│ 5 │ output a content integer +│ │ ‾ +├─ Test +│ +│ Incriminated subscope variable definition: +├─➤ tests/io/bad/inputing_to_not_input.catala_en:14.3-14.17: +│ │ +│ 14 │ definition a.a equals 0 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +└─ #return code 123# ``` diff --git a/tests/io/bad/redefining_input.catala_en b/tests/io/bad/redefining_input.catala_en index ff0234b24..dc851f695 100644 --- a/tests/io/bad/redefining_input.catala_en +++ b/tests/io/bad/redefining_input.catala_en @@ -9,19 +9,22 @@ scope A: ``` ```catala-test-inline $ catala Typecheck -[ERROR] There cannot be a definition for a scope variable tagged as input. - -Incriminated variable: -┌─⯈ tests/io/bad/redefining_input.catala_en:5.16-5.17: -└─┐ -5 │ input output a content integer - │ ‾ - └─ Test - -Incriminated variable definition: -┌─⯈ tests/io/bad/redefining_input.catala_en:8.3-8.15: -└─┐ -8 │ definition a equals 0 - │ ‾‾‾‾‾‾‾‾‾‾‾‾ +┌─[ERROR]─ +│ +│ There cannot be a definition for a scope variable tagged as input. +│ +│ Incriminated variable: +├─➤ tests/io/bad/redefining_input.catala_en:5.16-5.17: +│ │ +│ 5 │ input output a content integer +│ │ ‾ +├─ Test +│ +│ Incriminated variable definition: +├─➤ tests/io/bad/redefining_input.catala_en:8.3-8.15: +│ │ +│ 8 │ definition a equals 0 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾ +└─ #return code 123# ``` diff --git a/tests/io/bad/using_non_output.catala_en b/tests/io/bad/using_non_output.catala_en index d9bb5f506..03fbf9e52 100644 --- a/tests/io/bad/using_non_output.catala_en +++ b/tests/io/bad/using_non_output.catala_en @@ -15,20 +15,22 @@ scope B: ``` ```catala-test-inline $ catala Typecheck -[ERROR] Variable a is not a declared output of scope A. - -a is used here as an output -┌─⯈ tests/io/bad/using_non_output.catala_en:14.13-14.16: -└──┐ -14 │ assertion a.a = 0 - │ ‾‾‾ - └─ Test - -Scope A is declared here -┌─⯈ tests/io/bad/using_non_output.catala_en:4.19-4.20: -└─┐ -4 │ declaration scope A: - │ ‾ - └─ Test +┌─[ERROR]─ +│ +│ Variable a is not a declared output of scope A. +│ +│ a is used here as an output +├─➤ tests/io/bad/using_non_output.catala_en:14.13-14.16: +│ │ +│ 14 │ assertion a.a = 0 +│ │ ‾‾‾ +├─ Test +│ +│ Scope A is declared here +├─➤ tests/io/bad/using_non_output.catala_en:4.19-4.20: +│ │ +│ 4 │ declaration scope A: +│ │ ‾ +└─ Test #return code 123# ``` diff --git a/tests/io/good/all_io.catala_en b/tests/io/good/all_io.catala_en index 762c60b66..b519447dc 100644 --- a/tests/io/good/all_io.catala_en +++ b/tests/io/good/all_io.catala_en @@ -21,8 +21,12 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline @@ -57,5 +61,7 @@ let scope A ```catala-test-inline $ catala Typecheck -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` diff --git a/tests/io/good/condition_only_input.catala_en b/tests/io/good/condition_only_input.catala_en index 14772db14..40c30631a 100644 --- a/tests/io/good/condition_only_input.catala_en +++ b/tests/io/good/condition_only_input.catala_en @@ -18,8 +18,12 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline @@ -38,5 +42,7 @@ let scope B (B_in: B_in): B = ```catala-test-inline $ catala test-scope B -[RESULT] Computation successful! +┌─[RESULT]─ +│ Computation successful! +└─ ``` diff --git a/tests/io/good/subscope.catala_en b/tests/io/good/subscope.catala_en index 5aca91a1e..4f50ca9b8 100644 --- a/tests/io/good/subscope.catala_en +++ b/tests/io/good/subscope.catala_en @@ -24,8 +24,12 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline @@ -48,5 +52,7 @@ let scope B (B_in: B_in): B = ```catala-test-inline $ catala Typecheck -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` diff --git a/tests/literate/good/test_grave_char_en.catala_en b/tests/literate/good/test_grave_char_en.catala_en index 79e2de0f8..4da62f828 100644 --- a/tests/literate/good/test_grave_char_en.catala_en +++ b/tests/literate/good/test_grave_char_en.catala_en @@ -33,20 +33,26 @@ int main(void) { return 0; } ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] literate_parsing_is_ok = true +┌─[RESULT]─ +│ literate_parsing_is_ok = true +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] literate_parsing_is_ok = true +┌─[RESULT]─ +│ literate_parsing_is_ok = true +└─ ``` ```catala-test-inline @@ -91,19 +97,25 @@ int main(void) { return 0; } \begin{verbatim} $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ \end{verbatim} \begin{verbatim} $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] literate_parsing_is_ok = true +┌─[RESULT]─ +│ literate_parsing_is_ok = true +└─ \end{verbatim} \begin{verbatim} $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] literate_parsing_is_ok = true +┌─[RESULT]─ +│ literate_parsing_is_ok = true +└─ \end{verbatim} ``` diff --git a/tests/literate/good/test_grave_char_fr.catala_fr b/tests/literate/good/test_grave_char_fr.catala_fr index de474445a..df5930787 100644 --- a/tests/literate/good/test_grave_char_fr.catala_fr +++ b/tests/literate/good/test_grave_char_fr.catala_fr @@ -31,12 +31,17 @@ int main(void) { return 0; } ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] literate_parsing_is_ok = vrai +┌─[RESULT]─ +│ literate_parsing_is_ok = vrai +└─ ``` diff --git a/tests/literate/good/test_grave_char_pl.catala_pl b/tests/literate/good/test_grave_char_pl.catala_pl index 13654f765..3f02c39e4 100644 --- a/tests/literate/good/test_grave_char_pl.catala_pl +++ b/tests/literate/good/test_grave_char_pl.catala_pl @@ -29,6 +29,7 @@ int main(void) { return 0; } ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] literate_parsing_is_ok = prawda +┌─[RESULT]─ +│ literate_parsing_is_ok = prawda +└─ ``` diff --git a/tests/metadata/good/test_markup_refactoring.catala_en b/tests/metadata/good/test_markup_refactoring.catala_en index 54db6673f..65421e930 100644 --- a/tests/metadata/good/test_markup_refactoring.catala_en +++ b/tests/metadata/good/test_markup_refactoring.catala_en @@ -32,18 +32,24 @@ scope S2: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope S2 -[RESULT] Computation successful! Results: -[RESULT] b = B () +┌─[RESULT]─ +│ b = B () +└─ ``` ```catala-test-inline $ catala test-scope S -[RESULT] Computation successful! Results: -[RESULT] a = A () +┌─[RESULT]─ +│ a = A () +└─ ``` diff --git a/tests/modules/bad/mod_bad_include.catala_en b/tests/modules/bad/mod_bad_include.catala_en index 6d49b1d89..de0785037 100644 --- a/tests/modules/bad/mod_bad_include.catala_en +++ b/tests/modules/bad/mod_bad_include.catala_en @@ -3,20 +3,23 @@ ```catala-test-inline $ catala typecheck -[ERROR] A file that declares a module cannot be used through the raw '> Include' - directive. You should use it as a module with - '> Use This_is_not_the_file_name' instead. - -File include -┌─⯈ tests/modules/bad/mod_bad_include.catala_en:1.3-1.33: -└─┐ -1 │ > Include: mod_badname.catala_en - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - -Module declaration -┌─⯈ tests/modules/bad/mod_badname.catala_en:1.10-1.35: -└─┐ -1 │ > Module This_is_not_the_file_name - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +┌─[ERROR]─ +│ +│ A file that declares a module cannot be used through the raw '> Include' +│ directive. You should use it as a module with +│ '> Use This_is_not_the_file_name' instead. +│ +│ File include +├─➤ tests/modules/bad/mod_bad_include.catala_en:1.3-1.33: +│ │ +│ 1 │ > Include: mod_badname.catala_en +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +│ +│ Module declaration +├─➤ tests/modules/bad/mod_badname.catala_en:1.10-1.35: +│ │ +│ 1 │ > Module This_is_not_the_file_name +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +└─ #return code 123# ``` diff --git a/tests/modules/bad/mod_badname.catala_en b/tests/modules/bad/mod_badname.catala_en index f8c4aaff4..4c8435c39 100644 --- a/tests/modules/bad/mod_badname.catala_en +++ b/tests/modules/bad/mod_badname.catala_en @@ -3,14 +3,17 @@ ```catala-test-inline $ catala typecheck -[ERROR] Module declared as This_is_not_the_file_name, which does not match - the file name "tests/modules/bad/mod_badname.catala_en". - Rename the module to Mod_badname or the file to - "tests/modules/bad/This_is_not_the_file_name.catala_en". - -┌─⯈ tests/modules/bad/mod_badname.catala_en:1.10-1.35: -└─┐ -1 │ > Module This_is_not_the_file_name - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +┌─[ERROR]─ +│ +│ Module declared as This_is_not_the_file_name, which does not match the +│ file name "tests/modules/bad/mod_badname.catala_en". Rename the module to +│ Mod_badname or the file to +│ "tests/modules/bad/This_is_not_the_file_name.catala_en". +│ +├─➤ tests/modules/bad/mod_badname.catala_en:1.10-1.35: +│ │ +│ 1 │ > Module This_is_not_the_file_name +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +└─ #return code 123# ``` diff --git a/tests/modules/good/external_use.catala_en b/tests/modules/good/external_use.catala_en index 9f70c56e8..71d6bb07d 100644 --- a/tests/modules/good/external_use.catala_en +++ b/tests/modules/good/external_use.catala_en @@ -18,7 +18,8 @@ scope S: ```catala-test-inline $ catala test-scope S -[RESULT] Computation successful! Results: -[RESULT] result1 = [$3.33; $0.83; $0.83; $3.33; $0.83; $0.85] -[RESULT] result2 = [$3.33; $0.83; $0.83; $3.34; $0.84; $0.83] +┌─[RESULT]─ +│ result1 = [$3.33; $0.83; $0.83; $3.33; $0.83; $0.85] +│ result2 = [$3.33; $0.83; $0.83; $3.34; $0.84; $0.83] +└─ ``` diff --git a/tests/modules/good/mod_def.catala_en b/tests/modules/good/mod_def.catala_en index ef77bb9d3..4b0b1e84f 100644 --- a/tests/modules/good/mod_def.catala_en +++ b/tests/modules/good/mod_def.catala_en @@ -31,13 +31,19 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala typecheck --disable-warnings -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test { id="ml" } diff --git a/tests/modules/good/mod_def_context.catala_en b/tests/modules/good/mod_def_context.catala_en index 7d33ef2e1..d2ed55237 100644 --- a/tests/modules/good/mod_def_context.catala_en +++ b/tests/modules/good/mod_def_context.catala_en @@ -60,21 +60,24 @@ scope Stest: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope Stest -[RESULT] Computation successful! Results: -[RESULT] -o1 = S { -- ci: 0 -- cm: $0.00 -- cfun1: -- cfun2: } -[RESULT] -o2 = S { -- ci: 1 -- cm: $1.00 -- cfun1: -- cfun2: } -[RESULT] x11 = 12.0 -[RESULT] x12 = 6.0 -[RESULT] x21 = 8.0 -[RESULT] x22 = 6.0 +┌─[RESULT]─ +│ o1 = S { -- ci: 0 -- cm: $0.00 -- cfun1: -- cfun2: } +│ o2 = S { -- ci: 1 -- cm: $1.00 -- cfun1: -- cfun2: } +│ x11 = 12.0 +│ x12 = 6.0 +│ x21 = 8.0 +│ x22 = 6.0 +└─ ``` ### Testing subscopes (with and without context override) @@ -97,11 +100,12 @@ scope TestSubDefault: ```catala-test-inline $ catala test-scope TestSubDefault -[RESULT] Computation successful! Results: -[RESULT] ci = 0 -[RESULT] cm = $0.00 -[RESULT] x11 = 12.0 -[RESULT] x12 = 6.0 +┌─[RESULT]─ +│ ci = 0 +│ cm = $0.00 +│ x11 = 12.0 +│ x12 = 6.0 +└─ ``` ```catala @@ -125,9 +129,10 @@ scope TestSubOverride: ```catala-test-inline $ catala test-scope TestSubOverride -[RESULT] Computation successful! Results: -[RESULT] ci = 1 -[RESULT] cm = $1.00 -[RESULT] x21 = 8.0 -[RESULT] x22 = 6.0 +┌─[RESULT]─ +│ ci = 1 +│ cm = $1.00 +│ x21 = 8.0 +│ x22 = 6.0 +└─ ``` diff --git a/tests/modules/good/mod_middle.catala_en b/tests/modules/good/mod_middle.catala_en index 2c183206f..ebf36ec5f 100644 --- a/tests/modules/good/mod_middle.catala_en +++ b/tests/modules/good/mod_middle.catala_en @@ -21,11 +21,17 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala typecheck -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` diff --git a/tests/modules/good/mod_use.catala_en b/tests/modules/good/mod_use.catala_en index aa2905a7c..1c7796843 100644 --- a/tests/modules/good/mod_use.catala_en +++ b/tests/modules/good/mod_use.catala_en @@ -27,15 +27,20 @@ scope T2: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope T2 -[RESULT] Computation successful! Results: -[RESULT] o1 = No () -[RESULT] o2 = Maybe () -[RESULT] o3 = $1,000.00 -[RESULT] o4 = 5.0 +┌─[RESULT]─ +│ o1 = No () +│ o2 = Maybe () +│ o3 = $1,000.00 +│ o4 = 5.0 +└─ ``` diff --git a/tests/modules/good/mod_use2.catala_en b/tests/modules/good/mod_use2.catala_en index f1bc58c5e..6dd799295 100644 --- a/tests/modules/good/mod_use2.catala_en +++ b/tests/modules/good/mod_use2.catala_en @@ -19,16 +19,21 @@ scope T: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope T -[RESULT] Computation successful! Results: -[RESULT] o1 = Mod_def.S { -- sr: $1,000.00 -- e1: Maybe () } -[RESULT] o2 = $2,500.00 -[RESULT] o3 = $132.00 +┌─[RESULT]─ +│ o1 = Mod_def.S { -- sr: $1,000.00 -- e1: Maybe () } +│ o2 = $2,500.00 +│ o3 = $132.00 +└─ ``` The following tests multiple inclusion of the same module (Mod_def is used through Mod_middle here, and also directly by mod_use.catala_en included below) @@ -37,9 +42,10 @@ The following tests multiple inclusion of the same module (Mod_def is used throu ```catala-test-inline $ catala test-scope T2 -[RESULT] Computation successful! Results: -[RESULT] o1 = No () -[RESULT] o2 = Maybe () -[RESULT] o3 = $1,000.00 -[RESULT] o4 = 5.0 +┌─[RESULT]─ +│ o1 = No () +│ o2 = Maybe () +│ o3 = $1,000.00 +│ o4 = 5.0 +└─ ``` diff --git a/tests/modules/good/mod_use3.catala_en b/tests/modules/good/mod_use3.catala_en index c5066c579..640b23a24 100644 --- a/tests/modules/good/mod_use3.catala_en +++ b/tests/modules/good/mod_use3.catala_en @@ -23,14 +23,19 @@ scope T: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope T -[RESULT] Computation successful! Results: -[RESULT] o1 = Mod_def.S { -- sr: $1,000.00 -- e1: Maybe () } -[RESULT] o2 = $2,500.00 -[RESULT] o3 = $132.00 +┌─[RESULT]─ +│ o1 = Mod_def.S { -- sr: $1,000.00 -- e1: Maybe () } +│ o2 = $2,500.00 +│ o3 = $132.00 +└─ ``` diff --git a/tests/modules/good/mod_use_context.catala_en b/tests/modules/good/mod_use_context.catala_en index 973079eb4..a7255ebcf 100644 --- a/tests/modules/good/mod_use_context.catala_en +++ b/tests/modules/good/mod_use_context.catala_en @@ -44,33 +44,36 @@ scope TestCall: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope TestCall -[RESULT] Computation successful! Results: -[RESULT] -o_default = - Mod_def_context.S { - -- ci: 0 - -- cm: $0.00 - -- cfun1: - -- cfun2: - } -[RESULT] -o_override = - Mod_def_context.S { - -- ci: 1 - -- cm: $1.00 - -- cfun1: - -- cfun2: - } -[RESULT] x11 = 12.0 -[RESULT] x12 = 6.0 -[RESULT] x21 = 8.0 -[RESULT] x22 = 6.0 +┌─[RESULT]─ +│ o_default = +│ Mod_def_context.S { +│ -- ci: 0 +│ -- cm: $0.00 +│ -- cfun1: +│ -- cfun2: +│ } +│ o_override = +│ Mod_def_context.S { +│ -- ci: 1 +│ -- cm: $1.00 +│ -- cfun1: +│ -- cfun2: +│ } +│ x11 = 12.0 +│ x12 = 6.0 +│ x21 = 8.0 +│ x22 = 6.0 +└─ ``` @@ -94,11 +97,12 @@ scope TestSubDefault: ```catala-test-inline $ catala test-scope TestSubDefault -[RESULT] Computation successful! Results: -[RESULT] ci = 0 -[RESULT] cm = $0.00 -[RESULT] x11 = 12.0 -[RESULT] x12 = 6.0 +┌─[RESULT]─ +│ ci = 0 +│ cm = $0.00 +│ x11 = 12.0 +│ x12 = 6.0 +└─ ``` ```catala @@ -122,9 +126,10 @@ scope TestSubOverride: ```catala-test-inline $ catala test-scope TestSubOverride -[RESULT] Computation successful! Results: -[RESULT] ci = 1 -[RESULT] cm = $1.00 -[RESULT] x21 = 8.0 -[RESULT] x22 = 6.0 +┌─[RESULT]─ +│ ci = 1 +│ cm = $1.00 +│ x21 = 8.0 +│ x22 = 6.0 +└─ ``` diff --git a/tests/modules/good/prorata_syntax.catala_en b/tests/modules/good/prorata_syntax.catala_en index a5aa7524a..528e6a863 100644 --- a/tests/modules/good/prorata_syntax.catala_en +++ b/tests/modules/good/prorata_syntax.catala_en @@ -36,30 +36,34 @@ scope S: ```catala-test-inline $ catala typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope S -[RESULT] Computation successful! Results: -[RESULT] -result = - [ - HouseholdMemberTaxed { - -- member: - HouseholdMember { -- birthdate: 2000-01-01 -- revenue: $10,000.00 } - -- tax: $270.27 - }; - HouseholdMemberTaxed { - -- member: - HouseholdMember { -- birthdate: 2000-01-02 -- revenue: $1,000.00 } - -- tax: $27.03 - }; - HouseholdMemberTaxed { - -- member: - HouseholdMember { -- birthdate: 2000-01-02 -- revenue: $100.00 } - -- tax: $2.70 - } - ] +┌─[RESULT]─ +│ result = +│ [ +│ HouseholdMemberTaxed { +│ -- member: +│ HouseholdMember { -- birthdate: 2000-01-01 -- revenue: $10,000.00 } +│ -- tax: $270.27 +│ }; +│ HouseholdMemberTaxed { +│ -- member: +│ HouseholdMember { -- birthdate: 2000-01-02 -- revenue: $1,000.00 } +│ -- tax: $27.03 +│ }; +│ HouseholdMemberTaxed { +│ -- member: +│ HouseholdMember { -- birthdate: 2000-01-02 -- revenue: $100.00 } +│ -- tax: $2.70 +│ } +│ ] +└─ ``` diff --git a/tests/money/bad/no_mingle.catala_en b/tests/money/bad/no_mingle.catala_en index 7ea1a5d35..3325c371c 100644 --- a/tests/money/bad/no_mingle.catala_en +++ b/tests/money/bad/no_mingle.catala_en @@ -14,26 +14,28 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] I don't know how to apply operator * on types money and money - -┌─⯈ tests/money/bad/no_mingle.catala_en:12.24-12.29: -└──┐ -12 │ definition z equals (x * y) - │ ‾‾‾‾‾ - └─ Article - -Type money coming from expression: -┌─⯈ tests/money/bad/no_mingle.catala_en:5.21-5.26: -└─┐ -5 │ context x content money - │ ‾‾‾‾‾ - └─ Article - -Type money coming from expression: -┌─⯈ tests/money/bad/no_mingle.catala_en:6.21-6.26: -└─┐ -6 │ context y content money - │ ‾‾‾‾‾ - └─ Article +┌─[ERROR]─ +│ +│ I don't know how to apply operator * on types money and money +│ +├─➤ tests/money/bad/no_mingle.catala_en:12.24-12.29: +│ │ +│ 12 │ definition z equals (x * y) +│ │ ‾‾‾‾‾ +├─ Article +│ +│ Type money coming from expression: +├─➤ tests/money/bad/no_mingle.catala_en:5.21-5.26: +│ │ +│ 5 │ context x content money +│ │ ‾‾‾‾‾ +├─ Article +│ +│ Type money coming from expression: +├─➤ tests/money/bad/no_mingle.catala_en:6.21-6.26: +│ │ +│ 6 │ context y content money +│ │ ‾‾‾‾‾ +└─ Article #return code 123# ``` diff --git a/tests/money/good/literal_parsing.catala_en b/tests/money/good/literal_parsing.catala_en index 7cc75a570..0d1be5e7f 100644 --- a/tests/money/good/literal_parsing.catala_en +++ b/tests/money/good/literal_parsing.catala_en @@ -15,13 +15,18 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = $0.30 -[RESULT] y = -$0.30 +┌─[RESULT]─ +│ x = $0.30 +│ y = -$0.30 +└─ ``` diff --git a/tests/money/good/simple.catala_en b/tests/money/good/simple.catala_en index cba0c8639..b45400b4f 100644 --- a/tests/money/good/simple.catala_en +++ b/tests/money/good/simple.catala_en @@ -16,14 +16,19 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = $123.54 -[RESULT] y = $8,548,650.96 -[RESULT] z = $7.23 +┌─[RESULT]─ +│ x = $123.54 +│ y = $8,548,650.96 +│ z = $7.23 +└─ ``` diff --git a/tests/name_resolution/bad/toplevel_defs.catala_en b/tests/name_resolution/bad/toplevel_defs.catala_en index cda78acfa..89e64326d 100644 --- a/tests/name_resolution/bad/toplevel_defs.catala_en +++ b/tests/name_resolution/bad/toplevel_defs.catala_en @@ -13,12 +13,14 @@ declaration glob5 content decimal ```catala-test-inline $ catala typecheck -[ERROR] Scope calls are not allowed outside of a scope - -┌─⯈ tests/name_resolution/bad/toplevel_defs.catala_en:11.11-11.23: -└──┐ -11 │ equals (output of S1).a - │ ‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Scope calls are not allowed outside of scopes +┌─[ERROR]─ +│ +│ Scope calls are not allowed outside of a scope +│ +├─➤ tests/name_resolution/bad/toplevel_defs.catala_en:11.11-11.23: +│ │ +│ 11 │ equals (output of S1).a +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾ +└─ Scope calls are not allowed outside of scopes #return code 123# ``` diff --git a/tests/name_resolution/good/let_in.catala_en b/tests/name_resolution/good/let_in.catala_en index fd560ebcf..6628b96e1 100644 --- a/tests/name_resolution/good/let_in.catala_en +++ b/tests/name_resolution/good/let_in.catala_en @@ -29,15 +29,20 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope S -[RESULT] Computation successful! Results: -[RESULT] a = A { -- x: -2.0 -- y: B { -- y: false -- z: -1.0 } } -[RESULT] b = B { -- y: true -- z: 42.0 } +┌─[RESULT]─ +│ a = A { -- x: -2.0 -- y: B { -- y: false -- z: -1.0 } } +│ b = B { -- y: true -- z: 42.0 } +└─ ``` ## Check scope of let-in vs scope variable @@ -55,14 +60,17 @@ scope S2: ```catala-test-inline $ catala test-scope S2 -[WARNING] Unused varible: x does not contribute to computing any of scope S2 - outputs. Did you forget something? - -┌─⯈ tests/name_resolution/good/let_in.catala_en:47.4-47.5: -└──┐ -47 │ x scope S - │ ‾ - └─ Check scope of let-in vs scope variable -[RESULT] Computation successful! Results: -[RESULT] y = 1 +┌─[WARNING]─ +│ +│ Unused varible: x does not contribute to computing any of scope S2 +│ outputs. Did you forget something? +│ +├─➤ tests/name_resolution/good/let_in.catala_en:52.4-52.5: +│ │ +│ 52 │ x scope S +│ │ ‾ +└─ Check scope of let-in vs scope variable +┌─[RESULT]─ +│ y = 1 +└─ ``` diff --git a/tests/name_resolution/good/let_in2.catala_en b/tests/name_resolution/good/let_in2.catala_en index b02b3dc98..2253a9ff7 100644 --- a/tests/name_resolution/good/let_in2.catala_en +++ b/tests/name_resolution/good/let_in2.catala_en @@ -17,14 +17,19 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope S -[RESULT] Computation successful! Results: -[RESULT] a = true +┌─[RESULT]─ +│ a = true +└─ ``` ```catala-test-inline diff --git a/tests/name_resolution/good/out_of_order.catala_en b/tests/name_resolution/good/out_of_order.catala_en index a1b958439..ef71bccde 100644 --- a/tests/name_resolution/good/out_of_order.catala_en +++ b/tests/name_resolution/good/out_of_order.catala_en @@ -22,13 +22,18 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope S -[RESULT] Computation successful! Results: -[RESULT] a = A { -- x: 0 -- y: B { -- y: true -- z: 0.0 } } -[RESULT] b = B { -- y: true -- z: 0.0 } +┌─[RESULT]─ +│ a = A { -- x: 0 -- y: B { -- y: true -- z: 0.0 } } +│ b = B { -- y: true -- z: 0.0 } +└─ ``` diff --git a/tests/name_resolution/good/toplevel_defs.catala_en b/tests/name_resolution/good/toplevel_defs.catala_en index 97bfefb29..022b4421e 100644 --- a/tests/name_resolution/good/toplevel_defs.catala_en +++ b/tests/name_resolution/good/toplevel_defs.catala_en @@ -23,15 +23,20 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope S -[RESULT] Computation successful! Results: -[RESULT] a = 1,946.574,4 -[RESULT] b = A { -- y: true -- z: 2,091.0 } +┌─[RESULT]─ +│ a = 1,946.574,4 +│ b = A { -- y: true -- z: 2,091.0 } +└─ ``` ## Test toplevel function defs @@ -50,8 +55,9 @@ scope S2: ```catala-test-inline $ catala test-scope S2 -[RESULT] Computation successful! Results: -[RESULT] a = 154.0 +┌─[RESULT]─ +│ a = 154.0 +└─ ``` ## Test function def with two args @@ -70,8 +76,9 @@ scope S3: ```catala-test-inline $ catala test-scope S3 -[RESULT] Computation successful! Results: -[RESULT] a = 2,480.0 +┌─[RESULT]─ +│ a = 2,480.0 +└─ ``` ## Test inline defs in toplevel defs @@ -93,8 +100,9 @@ scope S4: ```catala-test-inline $ catala test-scope S4 -[RESULT] Computation successful! Results: -[RESULT] a = 6,001.0 +┌─[RESULT]─ +│ a = 6,001.0 +└─ ``` ```catala-test-inline @@ -426,8 +434,8 @@ def s2(s2_in:S2In): return (glob3(money_of_cents_string("4400")) + decimal_of_string("100.")) return handle_default(SourcePosition(filename="tests/name_resolution/good/toplevel_defs.catala_en", - start_line=48, start_column=24, - end_line=48, end_column=43, + start_line=53, start_column=24, + end_line=53, end_column=43, law_headings=["Test toplevel function defs"]), [], temp_a_1, temp_a_2) def temp_a_3(_:Unit): @@ -435,15 +443,15 @@ def s2(s2_in:S2In): def temp_a_4(_:Unit): raise Empty temp_a_5 = handle_default(SourcePosition(filename="tests/name_resolution/good/toplevel_defs.catala_en", - start_line=45, start_column=10, - end_line=45, end_column=11, + start_line=50, start_column=10, + end_line=50, end_column=11, law_headings=["Test toplevel function defs"]), [temp_a], temp_a_3, temp_a_4) except Empty: raise NoValue(SourcePosition( filename="tests/name_resolution/good/toplevel_defs.catala_en", - start_line=45, start_column=10, - end_line=45, end_column=11, + start_line=50, start_column=10, + end_line=50, end_column=11, law_headings=["Test toplevel function defs"])) a = temp_a_5 return S2(a = a) @@ -458,8 +466,8 @@ def s3(s3_in:S3In): glob4(money_of_cents_string("4400"), decimal_of_string("55."))) return handle_default(SourcePosition(filename="tests/name_resolution/good/toplevel_defs.catala_en", - start_line=68, start_column=24, - end_line=68, end_column=47, + start_line=74, start_column=24, + end_line=74, end_column=47, law_headings=["Test function def with two args"]), [], temp_a_7, temp_a_8) def temp_a_9(_:Unit): @@ -467,15 +475,15 @@ def s3(s3_in:S3In): def temp_a_10(_:Unit): raise Empty temp_a_11 = handle_default(SourcePosition(filename="tests/name_resolution/good/toplevel_defs.catala_en", - start_line=65, start_column=10, - end_line=65, end_column=11, + start_line=71, start_column=10, + end_line=71, end_column=11, law_headings=["Test function def with two args"]), [temp_a_6], temp_a_9, temp_a_10) except Empty: raise NoValue(SourcePosition( filename="tests/name_resolution/good/toplevel_defs.catala_en", - start_line=65, start_column=10, - end_line=65, end_column=11, + start_line=71, start_column=10, + end_line=71, end_column=11, law_headings=["Test function def with two args"])) a_1 = temp_a_11 return S3(a = a_1) @@ -488,8 +496,8 @@ def s4(s4_in:S4In): def temp_a_14(_:Unit): return (glob5 + decimal_of_string("1.")) return handle_default(SourcePosition(filename="tests/name_resolution/good/toplevel_defs.catala_en", - start_line=91, start_column=24, - end_line=91, end_column=34, + start_line=98, start_column=24, + end_line=98, end_column=34, law_headings=["Test inline defs in toplevel defs"]), [], temp_a_13, temp_a_14) def temp_a_15(_:Unit): @@ -497,15 +505,15 @@ def s4(s4_in:S4In): def temp_a_16(_:Unit): raise Empty temp_a_17 = handle_default(SourcePosition(filename="tests/name_resolution/good/toplevel_defs.catala_en", - start_line=88, start_column=10, - end_line=88, end_column=11, + start_line=95, start_column=10, + end_line=95, end_column=11, law_headings=["Test inline defs in toplevel defs"]), [temp_a_12], temp_a_15, temp_a_16) except Empty: raise NoValue(SourcePosition( filename="tests/name_resolution/good/toplevel_defs.catala_en", - start_line=88, start_column=10, - end_line=88, end_column=11, + start_line=95, start_column=10, + end_line=95, end_column=11, law_headings=["Test inline defs in toplevel defs"])) a_2 = temp_a_17 return S4(a = a_2) diff --git a/tests/name_resolution/good/toplevel_defs_simple.catala_en b/tests/name_resolution/good/toplevel_defs_simple.catala_en index bf08c7aad..2563b02e1 100644 --- a/tests/name_resolution/good/toplevel_defs_simple.catala_en +++ b/tests/name_resolution/good/toplevel_defs_simple.catala_en @@ -14,12 +14,17 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope S -[RESULT] Computation successful! Results: -[RESULT] a = true +┌─[RESULT]─ +│ a = true +└─ ``` diff --git a/tests/proof/bad/array_length-empty.catala_en b/tests/proof/bad/array_length-empty.catala_en index 4e6e38224..53f25490c 100644 --- a/tests/proof/bad/array_length-empty.catala_en +++ b/tests/proof/bad/array_length-empty.catala_en @@ -12,11 +12,15 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] [A.y] This variable might return an empty error: -┌─⯈ tests/proof/bad/array_length-empty.catala_en:6.10-6.11: -└─┐ +┌─[WARNING]─ +│ +│ [A.y] This variable might return an empty error: +─➤ tests/proof/bad/array_length-empty.catala_en:6.10-6.11: + │ 6 │ output y content boolean │ ‾ - └─ Test +Test Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/array_length-overlap.catala_en b/tests/proof/bad/array_length-overlap.catala_en index 7bc295c11..ef5aa7fb0 100644 --- a/tests/proof/bad/array_length-overlap.catala_en +++ b/tests/proof/bad/array_length-overlap.catala_en @@ -13,11 +13,15 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] [A.y] At least two exceptions overlap for this variable: -┌─⯈ tests/proof/bad/array_length-overlap.catala_en:6.10-6.11: -└─┐ +┌─[WARNING]─ +│ +│ [A.y] At least two exceptions overlap for this variable: +─➤ tests/proof/bad/array_length-overlap.catala_en:6.10-6.11: + │ 6 │ output y content boolean │ ‾ - └─ Test +Test Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/assert-empty.catala_en b/tests/proof/bad/assert-empty.catala_en index 2c7cd5e97..ca264978e 100644 --- a/tests/proof/bad/assert-empty.catala_en +++ b/tests/proof/bad/assert-empty.catala_en @@ -24,10 +24,14 @@ scope Foo: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] [Foo.x] This variable might return an empty error: -┌─⯈ tests/proof/bad/assert-empty.catala_en:4.11-4.12: -└─┐ +┌─[WARNING]─ +│ +│ [Foo.x] This variable might return an empty error: +─➤ tests/proof/bad/assert-empty.catala_en:4.11-4.12: + │ 4 │ output x content integer │ ‾ Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/dates_get_year-empty.catala_en b/tests/proof/bad/dates_get_year-empty.catala_en index 963146796..b38b5f5fd 100644 --- a/tests/proof/bad/dates_get_year-empty.catala_en +++ b/tests/proof/bad/dates_get_year-empty.catala_en @@ -15,19 +15,22 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[ERROR] There cannot be a definition for a scope variable tagged as input. - -Incriminated variable: -┌─⯈ tests/proof/bad/dates_get_year-empty.catala_en:5.9-5.10: -└─┐ -5 │ input x content date - │ ‾ - └─ Test - -Incriminated variable definition: -┌─⯈ tests/proof/bad/dates_get_year-empty.catala_en:9.3-9.15: -└─┐ -9 │ definition x equals |2022-01-16| - │ ‾‾‾‾‾‾‾‾‾‾‾‾ +┌─[ERROR]─ +│ +│ There cannot be a definition for a scope variable tagged as input. +│ +│ Incriminated variable: +├─➤ tests/proof/bad/dates_get_year-empty.catala_en:5.9-5.10: +│ │ +│ 5 │ input x content date +│ │ ‾ +├─ Test +│ +│ Incriminated variable definition: +├─➤ tests/proof/bad/dates_get_year-empty.catala_en:9.3-9.15: +│ │ +│ 9 │ definition x equals |2022-01-16| +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾ +└─ #return code 123# ``` diff --git a/tests/proof/bad/dates_get_year-overlap.catala_en b/tests/proof/bad/dates_get_year-overlap.catala_en index 95ca095c6..51c5319f9 100644 --- a/tests/proof/bad/dates_get_year-overlap.catala_en +++ b/tests/proof/bad/dates_get_year-overlap.catala_en @@ -15,11 +15,15 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] [A.y] At least two exceptions overlap for this variable: -┌─⯈ tests/proof/bad/dates_get_year-overlap.catala_en:6.10-6.11: -└─┐ +┌─[WARNING]─ +│ +│ [A.y] At least two exceptions overlap for this variable: +─➤ tests/proof/bad/dates_get_year-overlap.catala_en:6.10-6.11: + │ 6 │ output y content boolean │ ‾ - └─ Test +Test Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/dates_simple-empty.catala_en b/tests/proof/bad/dates_simple-empty.catala_en index 455c282e2..24a9ee3e1 100644 --- a/tests/proof/bad/dates_simple-empty.catala_en +++ b/tests/proof/bad/dates_simple-empty.catala_en @@ -14,11 +14,15 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] [A.y] This variable might return an empty error: -┌─⯈ tests/proof/bad/dates_simple-empty.catala_en:6.10-6.11: -└─┐ +┌─[WARNING]─ +│ +│ [A.y] This variable might return an empty error: +─➤ tests/proof/bad/dates_simple-empty.catala_en:6.10-6.11: + │ 6 │ output y content boolean │ ‾ - └─ Test +Test Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/dates_simple-overlap.catala_en b/tests/proof/bad/dates_simple-overlap.catala_en index afe4070fa..49a6ecf8d 100644 --- a/tests/proof/bad/dates_simple-overlap.catala_en +++ b/tests/proof/bad/dates_simple-overlap.catala_en @@ -15,11 +15,15 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] [A.y] At least two exceptions overlap for this variable: -┌─⯈ tests/proof/bad/dates_simple-overlap.catala_en:6.10-6.11: -└─┐ +┌─[WARNING]─ +│ +│ [A.y] At least two exceptions overlap for this variable: +─➤ tests/proof/bad/dates_simple-overlap.catala_en:6.10-6.11: + │ 6 │ output y content boolean │ ‾ - └─ Test +Test Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/duration-empty.catala_en b/tests/proof/bad/duration-empty.catala_en index e63604529..e76b23faf 100644 --- a/tests/proof/bad/duration-empty.catala_en +++ b/tests/proof/bad/duration-empty.catala_en @@ -12,11 +12,15 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] [A.y] This variable might return an empty error: -┌─⯈ tests/proof/bad/duration-empty.catala_en:6.10-6.11: -└─┐ +┌─[WARNING]─ +│ +│ [A.y] This variable might return an empty error: +─➤ tests/proof/bad/duration-empty.catala_en:6.10-6.11: + │ 6 │ output y content boolean │ ‾ - └─ Test +Test Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/duration-overlap.catala_en b/tests/proof/bad/duration-overlap.catala_en index 9cb57903d..d3fdeb7cd 100644 --- a/tests/proof/bad/duration-overlap.catala_en +++ b/tests/proof/bad/duration-overlap.catala_en @@ -13,11 +13,15 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] [A.y] At least two exceptions overlap for this variable: -┌─⯈ tests/proof/bad/duration-overlap.catala_en:6.10-6.11: -└─┐ +┌─[WARNING]─ +│ +│ [A.y] At least two exceptions overlap for this variable: +─➤ tests/proof/bad/duration-overlap.catala_en:6.10-6.11: + │ 6 │ output y content boolean │ ‾ - └─ Test +Test Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/enums-empty.catala_en b/tests/proof/bad/enums-empty.catala_en index 1e297a2d1..917b52419 100644 --- a/tests/proof/bad/enums-empty.catala_en +++ b/tests/proof/bad/enums-empty.catala_en @@ -23,19 +23,25 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] The constructor "C" of enumeration "T" is never used; - maybe it's unnecessary? - -┌─⯈ tests/proof/bad/enums-empty.catala_en:7.7-7.8: -└─┐ -7 │ -- C content boolean - │ ‾ - └─ Test -[WARNING] [A.x] This variable might return an empty error: -┌─⯈ tests/proof/bad/enums-empty.catala_en:15.10-15.11: -└──┐ +┌─[WARNING]─ +│ +│ The constructor "C" of enumeration "T" is never used; +│ maybe it's unnecessary? +│ +├─➤ tests/proof/bad/enums-empty.catala_en:7.7-7.8: +│ │ +│ 7 │ -- C content boolean +│ │ ‾ +└─ Test +┌─[WARNING]─ +│ +│ [A.x] This variable might return an empty error: +─➤ tests/proof/bad/enums-empty.catala_en:15.10-15.11: + │ 15 │ output x content integer │ ‾ - └─ Test +Test Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/enums-nonbool-empty.catala_en b/tests/proof/bad/enums-nonbool-empty.catala_en index 96870b751..02e0b49db 100644 --- a/tests/proof/bad/enums-nonbool-empty.catala_en +++ b/tests/proof/bad/enums-nonbool-empty.catala_en @@ -21,19 +21,25 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] The constructor "C" of enumeration "T" is never used; - maybe it's unnecessary? - -┌─⯈ tests/proof/bad/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/proof/bad/enums-nonbool-empty.catala_en:13.10-13.11: -└──┐ +┌─[WARNING]─ +│ +│ The constructor "C" of enumeration "T" is never used; +│ maybe it's unnecessary? +│ +├─➤ tests/proof/bad/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/proof/bad/enums-nonbool-empty.catala_en:13.10-13.11: + │ 13 │ output x content integer │ ‾ - └─ Test +Test Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/enums-nonbool-overlap.catala_en b/tests/proof/bad/enums-nonbool-overlap.catala_en index 25e9fdb87..4f0685773 100644 --- a/tests/proof/bad/enums-nonbool-overlap.catala_en +++ b/tests/proof/bad/enums-nonbool-overlap.catala_en @@ -21,19 +21,25 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] The constructor "C" of enumeration "T" is never used; - maybe it's unnecessary? - -┌─⯈ tests/proof/bad/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/proof/bad/enums-nonbool-overlap.catala_en:13.10-13.11: -└──┐ +┌─[WARNING]─ +│ +│ The constructor "C" of enumeration "T" is never used; +│ maybe it's unnecessary? +│ +├─➤ tests/proof/bad/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/proof/bad/enums-nonbool-overlap.catala_en:13.10-13.11: + │ 13 │ output x content integer │ ‾ - └─ Test +Test Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/enums-overlap.catala_en b/tests/proof/bad/enums-overlap.catala_en index ad4f78e18..602319d27 100644 --- a/tests/proof/bad/enums-overlap.catala_en +++ b/tests/proof/bad/enums-overlap.catala_en @@ -23,19 +23,25 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] The constructor "C" of enumeration "T" is never used; - maybe it's unnecessary? - -┌─⯈ tests/proof/bad/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/proof/bad/enums-overlap.catala_en:15.10-15.11: -└──┐ +┌─[WARNING]─ +│ +│ The constructor "C" of enumeration "T" is never used; +│ maybe it's unnecessary? +│ +├─➤ tests/proof/bad/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/proof/bad/enums-overlap.catala_en:15.10-15.11: + │ 15 │ output x content integer │ ‾ - └─ Test +Test Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/enums_inj-empty.catala_en b/tests/proof/bad/enums_inj-empty.catala_en index f922a1959..0ea7df853 100644 --- a/tests/proof/bad/enums_inj-empty.catala_en +++ b/tests/proof/bad/enums_inj-empty.catala_en @@ -16,19 +16,25 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] The constructor "C2" of enumeration "E" is never used; - maybe it's unnecessary? - -┌─⯈ tests/proof/bad/enums_inj-empty.catala_en:6.6-6.8: -└─┐ -6 │ -- C2 - │ ‾‾ - └─ Article -[WARNING] [A.y] This variable might return an empty error: -┌─⯈ tests/proof/bad/enums_inj-empty.catala_en:10.10-10.11: -└──┐ +┌─[WARNING]─ +│ +│ The constructor "C2" of enumeration "E" is never used; +│ maybe it's unnecessary? +│ +├─➤ tests/proof/bad/enums_inj-empty.catala_en:6.6-6.8: +│ │ +│ 6 │ -- C2 +│ │ ‾‾ +└─ Article +┌─[WARNING]─ +│ +│ [A.y] This variable might return an empty error: +─➤ tests/proof/bad/enums_inj-empty.catala_en:10.10-10.11: + │ 10 │ output y content integer │ ‾ - └─ Article +Article Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/enums_inj-overlap.catala_en b/tests/proof/bad/enums_inj-overlap.catala_en index cc538e2d2..daac94d80 100644 --- a/tests/proof/bad/enums_inj-overlap.catala_en +++ b/tests/proof/bad/enums_inj-overlap.catala_en @@ -18,11 +18,15 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] [A.y] At least two exceptions overlap for this variable: -┌─⯈ tests/proof/bad/enums_inj-overlap.catala_en:10.10-10.11: -└──┐ +┌─[WARNING]─ +│ +│ [A.y] At least two exceptions overlap for this variable: +─➤ tests/proof/bad/enums_inj-overlap.catala_en:10.10-10.11: + │ 10 │ output y content integer │ ‾ - └─ Article +Article Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/enums_unit-empty.catala_en b/tests/proof/bad/enums_unit-empty.catala_en index f5efbd49a..443b40359 100644 --- a/tests/proof/bad/enums_unit-empty.catala_en +++ b/tests/proof/bad/enums_unit-empty.catala_en @@ -21,11 +21,15 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] [A.y] This variable might return an empty error: -┌─⯈ tests/proof/bad/enums_unit-empty.catala_en:10.10-10.11: -└──┐ +┌─[WARNING]─ +│ +│ [A.y] This variable might return an empty error: +─➤ tests/proof/bad/enums_unit-empty.catala_en:10.10-10.11: + │ 10 │ output y content integer │ ‾ - └─ Article +Article Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/enums_unit-overlap.catala_en b/tests/proof/bad/enums_unit-overlap.catala_en index c07048f2f..be143aafa 100644 --- a/tests/proof/bad/enums_unit-overlap.catala_en +++ b/tests/proof/bad/enums_unit-overlap.catala_en @@ -21,11 +21,15 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] [A.y] At least two exceptions overlap for this variable: -┌─⯈ tests/proof/bad/enums_unit-overlap.catala_en:10.10-10.11: -└──┐ +┌─[WARNING]─ +│ +│ [A.y] At least two exceptions overlap for this variable: +─➤ tests/proof/bad/enums_unit-overlap.catala_en:10.10-10.11: + │ 10 │ output y content integer │ ‾ - └─ Article +Article Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/let_in_condition-empty.catala_en b/tests/proof/bad/let_in_condition-empty.catala_en index 1d1fd6dd0..044bdd21c 100644 --- a/tests/proof/bad/let_in_condition-empty.catala_en +++ b/tests/proof/bad/let_in_condition-empty.catala_en @@ -13,11 +13,15 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] [A.x] This variable might return an empty error: -┌─⯈ tests/proof/bad/let_in_condition-empty.catala_en:5.10-5.11: -└─┐ +┌─[WARNING]─ +│ +│ [A.x] This variable might return an empty error: +─➤ tests/proof/bad/let_in_condition-empty.catala_en:5.10-5.11: + │ 5 │ output x content boolean │ ‾ - └─ Test +Test Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/money-empty.catala_en b/tests/proof/bad/money-empty.catala_en index 06e1741e6..13ed675bb 100644 --- a/tests/proof/bad/money-empty.catala_en +++ b/tests/proof/bad/money-empty.catala_en @@ -16,11 +16,15 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] [A.y] This variable might return an empty error: -┌─⯈ tests/proof/bad/money-empty.catala_en:8.10-8.11: -└─┐ +┌─[WARNING]─ +│ +│ [A.y] This variable might return an empty error: +─➤ tests/proof/bad/money-empty.catala_en:8.10-8.11: + │ 8 │ output y content boolean │ ‾ - └─ Test +Test Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/money-overlap.catala_en b/tests/proof/bad/money-overlap.catala_en index 63e3968c8..51e50af46 100644 --- a/tests/proof/bad/money-overlap.catala_en +++ b/tests/proof/bad/money-overlap.catala_en @@ -17,11 +17,15 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] [A.y] At least two exceptions overlap for this variable: -┌─⯈ tests/proof/bad/money-overlap.catala_en:8.10-8.11: -└─┐ +┌─[WARNING]─ +│ +│ [A.y] At least two exceptions overlap for this variable: +─➤ tests/proof/bad/money-overlap.catala_en:8.10-8.11: + │ 8 │ output y content boolean │ ‾ - └─ Test +Test Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/no_vars-conflict.catala_en b/tests/proof/bad/no_vars-conflict.catala_en index e22dd926a..47ae5d872 100644 --- a/tests/proof/bad/no_vars-conflict.catala_en +++ b/tests/proof/bad/no_vars-conflict.catala_en @@ -17,11 +17,15 @@ scope A: ``` ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] [A.y] At least two exceptions overlap for this variable: -┌─⯈ tests/proof/bad/no_vars-conflict.catala_en:8.10-8.11: -└─┐ +┌─[WARNING]─ +│ +│ [A.y] At least two exceptions overlap for this variable: +─➤ tests/proof/bad/no_vars-conflict.catala_en:8.10-8.11: + │ 8 │ output y content integer │ ‾ - └─ Test +Test Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/no_vars-empty.catala_en b/tests/proof/bad/no_vars-empty.catala_en index 8b2aba98f..500d1168b 100644 --- a/tests/proof/bad/no_vars-empty.catala_en +++ b/tests/proof/bad/no_vars-empty.catala_en @@ -16,11 +16,15 @@ scope A: ``` ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] [A.y] This variable might return an empty error: -┌─⯈ tests/proof/bad/no_vars-empty.catala_en:7.10-7.11: -└─┐ +┌─[WARNING]─ +│ +│ [A.y] This variable might return an empty error: +─➤ tests/proof/bad/no_vars-empty.catala_en:7.10-7.11: + │ 7 │ output y content integer │ ‾ - └─ Test +Test Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/prolala_motivating_example.catala_en b/tests/proof/bad/prolala_motivating_example.catala_en index 19f4148f1..10fb4f117 100644 --- a/tests/proof/bad/prolala_motivating_example.catala_en +++ b/tests/proof/bad/prolala_motivating_example.catala_en @@ -123,29 +123,32 @@ scope Amount: ```catala-test-inline $ catala Proof --disable-counterexamples -[ERROR] Invalid assignment to a subscope variable that is not tagged as input - or context. - -Incriminated subscope: -┌─⯈ tests/proof/bad/prolala_motivating_example.catala_en:56.3-56.14: -└──┐ -56 │ eligibility scope Eligibility - │ ‾‾‾‾‾‾‾‾‾‾‾ - └┬ ProLaLa 2022 Super Cash Bonus - └─ Amount - -Incriminated variable: -┌─⯈ tests/proof/bad/prolala_motivating_example.catala_en:9.12-9.22: -└─┐ -9 │ internal is_student content boolean - │ ‾‾‾‾‾‾‾‾‾‾ - └┬ ProLaLa 2022 Super Cash Bonus - └─ Eligibility - -Incriminated subscope variable definition: -┌─⯈ tests/proof/bad/prolala_motivating_example.catala_en:64.3-64.36: -└──┐ -64 │ definition eligibility.is_student equals is_student - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +┌─[ERROR]─ +│ +│ Invalid assignment to a subscope variable that is not tagged as input or +│ context. +│ +│ Incriminated subscope: +├─➤ tests/proof/bad/prolala_motivating_example.catala_en:56.3-56.14: +│ │ +│ 56 │ eligibility scope Eligibility +│ │ ‾‾‾‾‾‾‾‾‾‾‾ +├─ ProLaLa 2022 Super Cash Bonus +│ └─ Amount +│ +│ Incriminated variable: +├─➤ tests/proof/bad/prolala_motivating_example.catala_en:9.12-9.22: +│ │ +│ 9 │ internal is_student content boolean +│ │ ‾‾‾‾‾‾‾‾‾‾ +├─ ProLaLa 2022 Super Cash Bonus +│ └─ Eligibility +│ +│ Incriminated subscope variable definition: +├─➤ tests/proof/bad/prolala_motivating_example.catala_en:64.3-64.36: +│ │ +│ 64 │ definition eligibility.is_student equals is_student +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +└─ #return code 123# ``` diff --git a/tests/proof/bad/rationals-empty.catala_en b/tests/proof/bad/rationals-empty.catala_en index 5e23356b4..56ebdb841 100644 --- a/tests/proof/bad/rationals-empty.catala_en +++ b/tests/proof/bad/rationals-empty.catala_en @@ -12,11 +12,15 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] [A.y] This variable might return an empty error: -┌─⯈ tests/proof/bad/rationals-empty.catala_en:6.10-6.11: -└─┐ +┌─[WARNING]─ +│ +│ [A.y] This variable might return an empty error: +─➤ tests/proof/bad/rationals-empty.catala_en:6.10-6.11: + │ 6 │ output y content boolean │ ‾ - └─ Test +Test Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/rationals-overlap.catala_en b/tests/proof/bad/rationals-overlap.catala_en index ee582f504..57a8e3452 100644 --- a/tests/proof/bad/rationals-overlap.catala_en +++ b/tests/proof/bad/rationals-overlap.catala_en @@ -13,11 +13,15 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] [A.y] At least two exceptions overlap for this variable: -┌─⯈ tests/proof/bad/rationals-overlap.catala_en:6.10-6.11: -└─┐ +┌─[WARNING]─ +│ +│ [A.y] At least two exceptions overlap for this variable: +─➤ tests/proof/bad/rationals-overlap.catala_en:6.10-6.11: + │ 6 │ output y content boolean │ ‾ - └─ Test +Test Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/sat_solving.catala_en b/tests/proof/bad/sat_solving.catala_en index 7e9565c37..beff7a048 100644 --- a/tests/proof/bad/sat_solving.catala_en +++ b/tests/proof/bad/sat_solving.catala_en @@ -40,11 +40,15 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] [A.x10] This variable might return an empty error: -┌─⯈ tests/proof/bad/sat_solving.catala_en:15.10-15.13: -└──┐ +┌─[WARNING]─ +│ +│ [A.x10] This variable might return an empty error: +─➤ tests/proof/bad/sat_solving.catala_en:15.10-15.13: + │ 15 │ output x10 content boolean │ ‾‾‾ - └─ Test +Test Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/structs-empty.catala_en b/tests/proof/bad/structs-empty.catala_en index dee5bf7de..d29e0d18b 100644 --- a/tests/proof/bad/structs-empty.catala_en +++ b/tests/proof/bad/structs-empty.catala_en @@ -21,11 +21,15 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] [A.x] This variable might return an empty error: -┌─⯈ tests/proof/bad/structs-empty.catala_en:13.10-13.11: -└──┐ +┌─[WARNING]─ +│ +│ [A.x] This variable might return an empty error: +─➤ tests/proof/bad/structs-empty.catala_en:13.10-13.11: + │ 13 │ output x content integer │ ‾ - └─ Test +Test Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/bad/structs-overlap.catala_en b/tests/proof/bad/structs-overlap.catala_en index faa026d77..9693d6dc1 100644 --- a/tests/proof/bad/structs-overlap.catala_en +++ b/tests/proof/bad/structs-overlap.catala_en @@ -21,11 +21,15 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] [A.x] At least two exceptions overlap for this variable: -┌─⯈ tests/proof/bad/structs-overlap.catala_en:13.10-13.11: -└──┐ +┌─[WARNING]─ +│ +│ [A.x] At least two exceptions overlap for this variable: +─➤ tests/proof/bad/structs-overlap.catala_en:13.10-13.11: + │ 13 │ output x content integer │ ‾ - └─ Test +Test Counterexample generation is disabled so none was generated. +│ +└─ ``` diff --git a/tests/proof/good/array_length.catala_en b/tests/proof/good/array_length.catala_en index 0d0a8311c..e4317f7ac 100644 --- a/tests/proof/good/array_length.catala_en +++ b/tests/proof/good/array_length.catala_en @@ -15,11 +15,17 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Proof --disable-counterexamples -[RESULT] No errors found during the proof mode run. +┌─[RESULT]─ +│ No errors found during the proof mode run. +└─ ``` diff --git a/tests/proof/good/assert.catala_en b/tests/proof/good/assert.catala_en index d9f6653c6..2281dcd02 100644 --- a/tests/proof/good/assert.catala_en +++ b/tests/proof/good/assert.catala_en @@ -26,11 +26,17 @@ scope Foo: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Proof --disable-counterexamples -[RESULT] No errors found during the proof mode run. +┌─[RESULT]─ +│ No errors found during the proof mode run. +└─ ``` diff --git a/tests/proof/good/dates_get_year.catala_en b/tests/proof/good/dates_get_year.catala_en index f8458a966..164187c25 100644 --- a/tests/proof/good/dates_get_year.catala_en +++ b/tests/proof/good/dates_get_year.catala_en @@ -17,11 +17,17 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Proof --disable-counterexamples -[RESULT] No errors found during the proof mode run. +┌─[RESULT]─ +│ No errors found during the proof mode run. +└─ ``` diff --git a/tests/proof/good/dates_simple.catala_en b/tests/proof/good/dates_simple.catala_en index c06d999f7..f875071f9 100644 --- a/tests/proof/good/dates_simple.catala_en +++ b/tests/proof/good/dates_simple.catala_en @@ -17,11 +17,17 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Proof --disable-counterexamples -[RESULT] No errors found during the proof mode run. +┌─[RESULT]─ +│ No errors found during the proof mode run. +└─ ``` diff --git a/tests/proof/good/direct_scope_call.catala_en b/tests/proof/good/direct_scope_call.catala_en index 663e4bc13..17599d20f 100644 --- a/tests/proof/good/direct_scope_call.catala_en +++ b/tests/proof/good/direct_scope_call.catala_en @@ -18,11 +18,17 @@ scope Foo: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Proof -s Foo -[RESULT] No errors found during the proof mode run. +┌─[RESULT]─ +│ No errors found during the proof mode run. +└─ ``` diff --git a/tests/proof/good/direct_scope_call_with_context.catala_en b/tests/proof/good/direct_scope_call_with_context.catala_en index 90d8d09e3..bc06c295e 100644 --- a/tests/proof/good/direct_scope_call_with_context.catala_en +++ b/tests/proof/good/direct_scope_call_with_context.catala_en @@ -19,11 +19,17 @@ scope Foo: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Proof -s Foo -[RESULT] No errors found during the proof mode run. +┌─[RESULT]─ +│ No errors found during the proof mode run. +└─ ``` diff --git a/tests/proof/good/duration.catala_en b/tests/proof/good/duration.catala_en index d1ee3936a..65b6cfe76 100644 --- a/tests/proof/good/duration.catala_en +++ b/tests/proof/good/duration.catala_en @@ -15,11 +15,17 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Proof --disable-counterexamples -[RESULT] No errors found during the proof mode run. +┌─[RESULT]─ +│ No errors found during the proof mode run. +└─ ``` diff --git a/tests/proof/good/enums-arith.catala_en b/tests/proof/good/enums-arith.catala_en index 34e2d9fb1..bf7ea0acf 100644 --- a/tests/proof/good/enums-arith.catala_en +++ b/tests/proof/good/enums-arith.catala_en @@ -23,27 +23,37 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[WARNING] The constructor "C" of enumeration "T" is never used; - maybe it's unnecessary? - -┌─⯈ tests/proof/good/enums-arith.catala_en:5.7-5.8: -└─┐ -5 │ -- C content boolean - │ ‾ - └─ Test -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[WARNING]─ +│ +│ The constructor "C" of enumeration "T" is never used; +│ maybe it's unnecessary? +│ +├─➤ tests/proof/good/enums-arith.catala_en:5.7-5.8: +│ │ +│ 5 │ -- C content boolean +│ │ ‾ +└─ Test +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] The constructor "C" of enumeration "T" is never used; - maybe it's unnecessary? - -┌─⯈ tests/proof/good/enums-arith.catala_en:5.7-5.8: -└─┐ -5 │ -- C content boolean - │ ‾ - └─ Test -[RESULT] No errors found during the proof mode run. +┌─[WARNING]─ +│ +│ The constructor "C" of enumeration "T" is never used; +│ maybe it's unnecessary? +│ +├─➤ tests/proof/good/enums-arith.catala_en:5.7-5.8: +│ │ +│ 5 │ -- C content boolean +│ │ ‾ +└─ Test +┌─[RESULT]─ +│ No errors found during the proof mode run. +└─ ``` diff --git a/tests/proof/good/enums-nonbool.catala_en b/tests/proof/good/enums-nonbool.catala_en index a7c448950..9b830e69c 100644 --- a/tests/proof/good/enums-nonbool.catala_en +++ b/tests/proof/good/enums-nonbool.catala_en @@ -23,27 +23,37 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[WARNING] The constructor "C" of enumeration "T" is never used; - maybe it's unnecessary? - -┌─⯈ tests/proof/good/enums-nonbool.catala_en:5.7-5.8: -└─┐ -5 │ -- C content boolean - │ ‾ - └─ Test -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[WARNING]─ +│ +│ The constructor "C" of enumeration "T" is never used; +│ maybe it's unnecessary? +│ +├─➤ tests/proof/good/enums-nonbool.catala_en:5.7-5.8: +│ │ +│ 5 │ -- C content boolean +│ │ ‾ +└─ Test +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] The constructor "C" of enumeration "T" is never used; - maybe it's unnecessary? - -┌─⯈ tests/proof/good/enums-nonbool.catala_en:5.7-5.8: -└─┐ -5 │ -- C content boolean - │ ‾ - └─ Test -[RESULT] No errors found during the proof mode run. +┌─[WARNING]─ +│ +│ The constructor "C" of enumeration "T" is never used; +│ maybe it's unnecessary? +│ +├─➤ tests/proof/good/enums-nonbool.catala_en:5.7-5.8: +│ │ +│ 5 │ -- C content boolean +│ │ ‾ +└─ Test +┌─[RESULT]─ +│ No errors found during the proof mode run. +└─ ``` diff --git a/tests/proof/good/enums.catala_en b/tests/proof/good/enums.catala_en index 3cda97a77..05bca9c0c 100644 --- a/tests/proof/good/enums.catala_en +++ b/tests/proof/good/enums.catala_en @@ -22,27 +22,37 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[WARNING] The constructor "C" of enumeration "T" is never used; - maybe it's unnecessary? - -┌─⯈ tests/proof/good/enums.catala_en:5.7-5.8: -└─┐ -5 │ -- C content boolean - │ ‾ - └─ Test -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[WARNING]─ +│ +│ The constructor "C" of enumeration "T" is never used; +│ maybe it's unnecessary? +│ +├─➤ tests/proof/good/enums.catala_en:5.7-5.8: +│ │ +│ 5 │ -- C content boolean +│ │ ‾ +└─ Test +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] The constructor "C" of enumeration "T" is never used; - maybe it's unnecessary? - -┌─⯈ tests/proof/good/enums.catala_en:5.7-5.8: -└─┐ -5 │ -- C content boolean - │ ‾ - └─ Test -[RESULT] No errors found during the proof mode run. +┌─[WARNING]─ +│ +│ The constructor "C" of enumeration "T" is never used; +│ maybe it's unnecessary? +│ +├─➤ tests/proof/good/enums.catala_en:5.7-5.8: +│ │ +│ 5 │ -- C content boolean +│ │ ‾ +└─ Test +┌─[RESULT]─ +│ No errors found during the proof mode run. +└─ ``` diff --git a/tests/proof/good/enums_inj.catala_en b/tests/proof/good/enums_inj.catala_en index fae82d29e..3166fb699 100644 --- a/tests/proof/good/enums_inj.catala_en +++ b/tests/proof/good/enums_inj.catala_en @@ -19,11 +19,17 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Proof --disable-counterexamples -[RESULT] No errors found during the proof mode run. +┌─[RESULT]─ +│ No errors found during the proof mode run. +└─ ``` diff --git a/tests/proof/good/enums_unit.catala_en b/tests/proof/good/enums_unit.catala_en index 6f8b90ead..7f4a2ffa0 100644 --- a/tests/proof/good/enums_unit.catala_en +++ b/tests/proof/good/enums_unit.catala_en @@ -23,11 +23,17 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Proof --disable-counterexamples -[RESULT] No errors found during the proof mode run. +┌─[RESULT]─ +│ No errors found during the proof mode run. +└─ ``` diff --git a/tests/proof/good/functions.catala_en b/tests/proof/good/functions.catala_en index 226b44cf2..29f9444a9 100644 --- a/tests/proof/good/functions.catala_en +++ b/tests/proof/good/functions.catala_en @@ -16,11 +16,17 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Proof --disable-counterexamples -[RESULT] No errors found during the proof mode run. +┌─[RESULT]─ +│ No errors found during the proof mode run. +└─ ``` diff --git a/tests/proof/good/let_in_condition.catala_en b/tests/proof/good/let_in_condition.catala_en index 2732e22ad..54a3ee1c8 100644 --- a/tests/proof/good/let_in_condition.catala_en +++ b/tests/proof/good/let_in_condition.catala_en @@ -15,11 +15,17 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Proof --disable-counterexamples -[RESULT] No errors found during the proof mode run. +┌─[RESULT]─ +│ No errors found during the proof mode run. +└─ ``` diff --git a/tests/proof/good/money.catala_en b/tests/proof/good/money.catala_en index c3b3a02c9..b08992ff5 100644 --- a/tests/proof/good/money.catala_en +++ b/tests/proof/good/money.catala_en @@ -17,11 +17,17 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Proof --disable-counterexamples -[RESULT] No errors found during the proof mode run. +┌─[RESULT]─ +│ No errors found during the proof mode run. +└─ ``` diff --git a/tests/proof/good/no_vars.catala_en b/tests/proof/good/no_vars.catala_en index 85b368dce..4e491be27 100644 --- a/tests/proof/good/no_vars.catala_en +++ b/tests/proof/good/no_vars.catala_en @@ -12,11 +12,17 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Proof --disable-counterexamples -[RESULT] No errors found during the proof mode run. +┌─[RESULT]─ +│ No errors found during the proof mode run. +└─ ``` diff --git a/tests/proof/good/rationals.catala_en b/tests/proof/good/rationals.catala_en index de97d0f06..fad466211 100644 --- a/tests/proof/good/rationals.catala_en +++ b/tests/proof/good/rationals.catala_en @@ -15,11 +15,17 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Proof --disable-counterexamples -[RESULT] No errors found during the proof mode run. +┌─[RESULT]─ +│ No errors found during the proof mode run. +└─ ``` diff --git a/tests/proof/good/simple_vars.catala_en b/tests/proof/good/simple_vars.catala_en index 8d316799a..b7e8eac1f 100644 --- a/tests/proof/good/simple_vars.catala_en +++ b/tests/proof/good/simple_vars.catala_en @@ -18,11 +18,17 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Proof --disable-counterexamples -[RESULT] No errors found during the proof mode run. +┌─[RESULT]─ +│ No errors found during the proof mode run. +└─ ``` diff --git a/tests/proof/good/structs.catala_en b/tests/proof/good/structs.catala_en index 0555c3130..3fc9915c1 100644 --- a/tests/proof/good/structs.catala_en +++ b/tests/proof/good/structs.catala_en @@ -22,11 +22,17 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Proof --disable-counterexamples -[RESULT] No errors found during the proof mode run. +┌─[RESULT]─ +│ No errors found during the proof mode run. +└─ ``` diff --git a/tests/scope/bad/cycle_in_scope.catala_en b/tests/scope/bad/cycle_in_scope.catala_en index 471c38173..24eaf8d61 100644 --- a/tests/scope/bad/cycle_in_scope.catala_en +++ b/tests/scope/bad/cycle_in_scope.catala_en @@ -16,28 +16,30 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] Cyclic dependency detected between the following variables of scope A: - z → x → y → z - -z is used here in the definition of x: -┌─⯈ tests/scope/bad/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/scope/bad/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/scope/bad/cycle_in_scope.catala_en:13.32-13.33: -└──┐ -13 │ definition z under condition y < 1 consequence equals y - │ ‾ - └─ Article +┌─[ERROR]─ +│ +│ Cyclic dependency detected between the following variables of scope A: +│ z → x → y → z +│ +│ z is used here in the definition of x: +├─➤ tests/scope/bad/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/scope/bad/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/scope/bad/cycle_in_scope.catala_en:13.32-13.33: +│ │ +│ 13 │ definition z under condition y < 1 consequence equals y +│ │ ‾ +└─ Article #return code 123# ``` diff --git a/tests/scope/bad/cyclic_scope_calls.catala_en b/tests/scope/bad/cyclic_scope_calls.catala_en index 75c4a273b..06bec0a58 100644 --- a/tests/scope/bad/cyclic_scope_calls.catala_en +++ b/tests/scope/bad/cyclic_scope_calls.catala_en @@ -28,25 +28,28 @@ scope S4: ```catala-test-inline $ catala typecheck -[ERROR] Cyclic dependency detected between the following scopes: - S4 → S3 → S2 → S4 - -S4 is used here in the definition of S3: -┌─⯈ tests/scope/bad/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/scope/bad/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/scope/bad/cyclic_scope_calls.catala_en:24.24-24.36: -└──┐ -24 │ definition o equals (output of S2).o - │ ‾‾‾‾‾‾‾‾‾‾‾‾ +┌─[ERROR]─ +│ +│ Cyclic dependency detected between the following scopes: +│ S4 → S3 → S2 → S4 +│ +│ S4 is used here in the definition of S3: +├─➤ tests/scope/bad/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/scope/bad/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/scope/bad/cyclic_scope_calls.catala_en:24.24-24.36: +│ │ +│ 24 │ definition o equals (output of S2).o +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾ +└─ #return code 123# ``` diff --git a/tests/scope/bad/cyclic_scopes.catala_en b/tests/scope/bad/cyclic_scopes.catala_en index efb316c6d..643cc4f2d 100644 --- a/tests/scope/bad/cyclic_scopes.catala_en +++ b/tests/scope/bad/cyclic_scopes.catala_en @@ -18,21 +18,22 @@ scope B: ```catala-test-inline $ catala test-scope A -[ERROR] Cyclic dependency detected between the following scopes: - B → A → B - -B is used here in the definition of A: -┌─⯈ tests/scope/bad/cyclic_scopes.catala_en:5.3-5.4: -└─┐ -5 │ b scope B - │ ‾ - └─ Article - -A is used here in the definition of B: -┌─⯈ tests/scope/bad/cyclic_scopes.catala_en:9.3-9.4: -└─┐ -9 │ a scope A - │ ‾ - └─ Article +┌─[ERROR]─ +│ +│ Cyclic dependency detected between the following scopes: B → A → B +│ +│ B is used here in the definition of A: +├─➤ tests/scope/bad/cyclic_scopes.catala_en:5.3-5.4: +│ │ +│ 5 │ b scope B +│ │ ‾ +├─ Article +│ +│ A is used here in the definition of B: +├─➤ tests/scope/bad/cyclic_scopes.catala_en:9.3-9.4: +│ │ +│ 9 │ a scope A +│ │ ‾ +└─ Article #return code 123# ``` diff --git a/tests/scope/bad/scope.catala_en b/tests/scope/bad/scope.catala_en index 207f187d7..c7035dae3 100644 --- a/tests/scope/bad/scope.catala_en +++ b/tests/scope/bad/scope.catala_en @@ -16,19 +16,21 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] During evaluation: conflict between multiple valid consequences for - assigning the same variable. - -┌─⯈ tests/scope/bad/scope.catala_en:13.57-13.61: -└──┐ -13 │ definition b under condition not c consequence equals 1337 - │ ‾‾‾‾ - └─ Article - -┌─⯈ tests/scope/bad/scope.catala_en:14.57-14.58: -└──┐ -14 │ definition b under condition not c consequence equals 0 - │ ‾ - └─ Article +┌─[ERROR]─ +│ +│ During evaluation: conflict between multiple valid consequences for +│ assigning the same variable. +│ +├─➤ tests/scope/bad/scope.catala_en:13.57-13.61: +│ │ +│ 13 │ definition b under condition not c consequence equals 1337 +│ │ ‾‾‾‾ +├─ Article +│ +├─➤ tests/scope/bad/scope.catala_en:14.57-14.58: +│ │ +│ 14 │ definition b under condition not c consequence equals 0 +│ │ ‾ +└─ Article #return code 123# ``` diff --git a/tests/scope/bad/scope_call_duplicate.catala_en b/tests/scope/bad/scope_call_duplicate.catala_en index 900ca3c43..3d91bf35f 100644 --- a/tests/scope/bad/scope_call_duplicate.catala_en +++ b/tests/scope/bad/scope_call_duplicate.catala_en @@ -16,11 +16,14 @@ scope Titi: ```catala-test-inline $ catala dcalc -s Titi -[ERROR] Duplicate definition of scope input variable 'bar' - -┌─⯈ tests/scope/bad/scope_call_duplicate.catala_en:14.70-14.73: -└──┐ -14 │ definition fizz equals output of Toto with {--bar: 1 --baz: 2.1 -- bar: 3} - │ ‾‾‾ +┌─[ERROR]─ +│ +│ Duplicate definition of scope input variable 'bar' +│ +├─➤ tests/scope/bad/scope_call_duplicate.catala_en:14.70-14.73: +│ │ +│ 14 │ definition fizz equals output of Toto with {--bar: 1 --baz: 2.1 -- bar: 3} +│ │ ‾‾‾ +└─ #return code 123# ``` diff --git a/tests/scope/bad/scope_call_extra.catala_en b/tests/scope/bad/scope_call_extra.catala_en index 8ecfdb933..910553545 100644 --- a/tests/scope/bad/scope_call_extra.catala_en +++ b/tests/scope/bad/scope_call_extra.catala_en @@ -16,21 +16,22 @@ scope Titi: ```catala-test-inline $ catala dcalc -s Titi -[ERROR] Scope Toto has no input variable biz - -┌─⯈ tests/scope/bad/scope_call_extra.catala_en:14.49-14.52: -└──┐ -14 │ definition fizz equals output of Toto with {--biz: 1} - │ ‾‾‾ - -Scope Toto declared here -┌─⯈ tests/scope/bad/scope_call_extra.catala_en:2.19-2.23: -└─┐ -2 │ declaration scope Toto: - │ ‾‾‾‾ - -Maybe you wanted to write : "bar", -or "baz", -or "foo" +┌─[ERROR]─ +│ +│ Scope Toto has no input variable biz +│ +├─➤ tests/scope/bad/scope_call_extra.catala_en:14.49-14.52: +│ │ +│ 14 │ definition fizz equals output of Toto with {--biz: 1} +│ │ ‾‾‾ +│ +│ Scope Toto declared here +├─➤ tests/scope/bad/scope_call_extra.catala_en:2.19-2.23: +│ │ +│ 2 │ declaration scope Toto: +│ │ ‾‾‾‾ +│ +│ Maybe you wanted to write : "bar", or "baz", or "foo" ? +└─ #return code 123# ``` diff --git a/tests/scope/bad/scope_call_missing.catala_en b/tests/scope/bad/scope_call_missing.catala_en index ae0d7156b..cf540a927 100644 --- a/tests/scope/bad/scope_call_missing.catala_en +++ b/tests/scope/bad/scope_call_missing.catala_en @@ -16,17 +16,20 @@ scope Titi: ```catala-test-inline $ catala dcalc -s Titi -[ERROR] Definition of input variable 'baz' missing in this scope call - -┌─⯈ tests/scope/bad/scope_call_missing.catala_en:14.26-14.57: -└──┐ -14 │ definition fizz equals output of Toto with {--bar: 1 } - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - -Declaration of the missing input variable -┌─⯈ tests/scope/bad/scope_call_missing.catala_en:4.16-4.19: -└─┐ -4 │ input output baz content decimal - │ ‾‾‾ +┌─[ERROR]─ +│ +│ Definition of input variable 'baz' missing in this scope call +│ +├─➤ tests/scope/bad/scope_call_missing.catala_en:14.26-14.57: +│ │ +│ 14 │ definition fizz equals output of Toto with {--bar: 1 } +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +│ +│ Declaration of the missing input variable +├─➤ tests/scope/bad/scope_call_missing.catala_en:4.16-4.19: +│ │ +│ 4 │ input output baz content decimal +│ │ ‾‾‾ +└─ #return code 123# ``` diff --git a/tests/scope/bad/sub_vars_in_sub_var.catala_en b/tests/scope/bad/sub_vars_in_sub_var.catala_en index a1e6f55de..39cf1320d 100644 --- a/tests/scope/bad/sub_vars_in_sub_var.catala_en +++ b/tests/scope/bad/sub_vars_in_sub_var.catala_en @@ -15,13 +15,15 @@ scope B: ```catala-test-inline $ catala test-scope A -[ERROR] The subscope a is used in the definition of its own input a.y - (Catala doesn't support recursion) - -┌─⯈ tests/scope/bad/sub_vars_in_sub_var.catala_en:13.28-13.29: -└──┐ -13 │ definition a.y equals if a.x then 0 else 1 - │ ‾ - └─ Article +┌─[ERROR]─ +│ +│ The subscope a is used in the definition of its own input a.y +│ (Catala doesn't support recursion) +│ +├─➤ tests/scope/bad/sub_vars_in_sub_var.catala_en:13.28-13.29: +│ │ +│ 13 │ definition a.y equals if a.x then 0 else 1 +│ │ ‾ +└─ Article #return code 123# ``` diff --git a/tests/scope/good/191_fix_record_name_confusion.catala_en b/tests/scope/good/191_fix_record_name_confusion.catala_en index ad7070ba6..7a4a8450c 100644 --- a/tests/scope/good/191_fix_record_name_confusion.catala_en +++ b/tests/scope/good/191_fix_record_name_confusion.catala_en @@ -19,8 +19,12 @@ scope ScopeB: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline diff --git a/tests/scope/good/grand_parent_caller.catala_en b/tests/scope/good/grand_parent_caller.catala_en index b1d907e4b..42d1eb9bd 100644 --- a/tests/scope/good/grand_parent_caller.catala_en +++ b/tests/scope/good/grand_parent_caller.catala_en @@ -33,26 +33,33 @@ scope C: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] x = 0 +┌─[RESULT]─ +│ x = 0 +└─ ``` ```catala-test-inline $ catala test-scope B -[RESULT] Computation successful! Results: -[RESULT] y1 = 1 -[RESULT] y2 = 1 +┌─[RESULT]─ +│ y1 = 1 +│ y2 = 1 +└─ ``` ```catala-test-inline $ catala test-scope C -[RESULT] Computation successful! Results: -[RESULT] z1 = 2 -[RESULT] z2 = 2 +┌─[RESULT]─ +│ z1 = 2 +│ z2 = 2 +└─ ``` diff --git a/tests/scope/good/local-capture-subscope.catala_en b/tests/scope/good/local-capture-subscope.catala_en index f74a2ea70..fb18172ba 100644 --- a/tests/scope/good/local-capture-subscope.catala_en +++ b/tests/scope/good/local-capture-subscope.catala_en @@ -20,15 +20,19 @@ scope S: ```catala-test-inline $ catala test-scope S -[WARNING] Unused varible: a does not contribute to computing any of scope S - outputs. Did you forget something? - -┌─⯈ tests/scope/good/local-capture-subscope.catala_en:7.3-7.4: -└─┐ -7 │ a scope A - │ ‾ -[RESULT] Computation successful! Results: -[RESULT] so = 42 +┌─[WARNING]─ +│ +│ Unused varible: a does not contribute to computing any of scope S outputs. +│ Did you forget something? +│ +├─➤ tests/scope/good/local-capture-subscope.catala_en:7.3-7.4: +│ │ +│ 7 │ a scope A +│ │ ‾ +└─ +┌─[RESULT]─ +│ so = 42 +└─ ``` diff --git a/tests/scope/good/nothing.catala_en b/tests/scope/good/nothing.catala_en index f4643a8a9..21a0916d1 100644 --- a/tests/scope/good/nothing.catala_en +++ b/tests/scope/good/nothing.catala_en @@ -9,28 +9,36 @@ declaration scope Foo2: ```catala-test-inline $ catala Typecheck --check-invariants -[WARNING] In scope "Foo2", the variable "bar" is declared but never defined; - did you forget something? - -┌─⯈ tests/scope/good/nothing.catala_en:5.10-5.13: -└─┐ -5 │ output bar content integer - │ ‾‾‾ - └─ Test -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[WARNING]─ +│ +│ In scope "Foo2", the variable "bar" is declared but never defined; +│ did you forget something? +│ +├─➤ tests/scope/good/nothing.catala_en:5.10-5.13: +│ │ +│ 5 │ output bar content integer +│ │ ‾‾‾ +└─ Test +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Scalc -s Foo2 -O -t -[WARNING] In scope "Foo2", the variable "bar" is declared but never defined; - did you forget something? - -┌─⯈ tests/scope/good/nothing.catala_en:5.10-5.13: -└─┐ -5 │ output bar content integer - │ ‾‾‾ - └─ Test +┌─[WARNING]─ +│ +│ In scope "Foo2", the variable "bar" is declared but never defined; +│ did you forget something? +│ +├─➤ tests/scope/good/nothing.catala_en:5.10-5.13: +│ │ +│ 5 │ output bar content integer +│ │ ‾‾‾ +└─ Test let Foo2_3 (Foo2_in_2: Foo2_in) = decl temp_bar_4 : integer; fatal NoValue; diff --git a/tests/scope/good/out_sub_scope.catala_en b/tests/scope/good/out_sub_scope.catala_en index bfb534c7b..3c075d3d1 100644 --- a/tests/scope/good/out_sub_scope.catala_en +++ b/tests/scope/good/out_sub_scope.catala_en @@ -21,7 +21,8 @@ scope B: ```catala-test-inline $ catala test-scope B -[RESULT] Computation successful! Results: -[RESULT] a = A { -- o: 99 -- io: 100 } -[RESULT] b = 99 +┌─[RESULT]─ +│ a = A { -- o: 99 -- io: 100 } +│ b = 99 +└─ ``` diff --git a/tests/scope/good/scope_call.catala_en b/tests/scope/good/scope_call.catala_en index 51a107f53..5532ae527 100644 --- a/tests/scope/good/scope_call.catala_en +++ b/tests/scope/good/scope_call.catala_en @@ -24,12 +24,17 @@ scope Foo: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope Foo -[RESULT] Computation successful! Results: -[RESULT] example = -7 +┌─[RESULT]─ +│ example = -7 +└─ ``` diff --git a/tests/scope/good/scope_call2.catala_en b/tests/scope/good/scope_call2.catala_en index e92150b35..30d4e1572 100644 --- a/tests/scope/good/scope_call2.catala_en +++ b/tests/scope/good/scope_call2.catala_en @@ -22,27 +22,38 @@ scope Titi: ```catala-test-inline $ catala Typecheck --check-invariants -[WARNING] Unused varible: toto does not contribute to computing any of scope - Titi outputs. Did you forget something? - -┌─⯈ tests/scope/good/scope_call2.catala_en:13.3-13.7: -└──┐ -13 │ toto scope Toto - │ ‾‾‾‾ -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[WARNING]─ +│ +│ Unused varible: toto does not contribute to computing any of scope Titi +│ outputs. Did you forget something? +│ +├─➤ tests/scope/good/scope_call2.catala_en:13.3-13.7: +│ │ +│ 13 │ toto scope Toto +│ │ ‾‾‾‾ +└─ +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope Titi -[WARNING] Unused varible: toto does not contribute to computing any of scope - Titi outputs. Did you forget something? - -┌─⯈ tests/scope/good/scope_call2.catala_en:13.3-13.7: -└──┐ -13 │ toto scope Toto - │ ‾‾‾‾ -[RESULT] Computation successful! Results: -[RESULT] fizz = Toto { -- foo: 1,213 } -[RESULT] fuzz = Toto { -- foo: 1,323 } +┌─[WARNING]─ +│ +│ Unused varible: toto does not contribute to computing any of scope Titi +│ outputs. Did you forget something? +│ +├─➤ tests/scope/good/scope_call2.catala_en:13.3-13.7: +│ │ +│ 13 │ toto scope Toto +│ │ ‾‾‾‾ +└─ +┌─[RESULT]─ +│ fizz = Toto { -- foo: 1,213 } +│ fuzz = Toto { -- foo: 1,323 } +└─ ``` diff --git a/tests/scope/good/scope_call3.catala_en b/tests/scope/good/scope_call3.catala_en index 3176d9ad1..c43a290c2 100644 --- a/tests/scope/good/scope_call3.catala_en +++ b/tests/scope/good/scope_call3.catala_en @@ -20,8 +20,12 @@ scope RentComputation: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline @@ -42,15 +46,15 @@ $ catala Interpret -t -s HousingComputation --debug [DEBUG] Starting interpretation... [LOG] ≔ HousingComputation.f: λ (x_67: integer) → error_empty ⟨ ⟨#{☛ } true ⊢ ⟨(let result_68 : RentComputation = (#{→ RentComputation.direct} (λ (RentComputation_in_69: RentComputation_in) → let g_70 : integer → integer = #{≔ RentComputation.g} (λ (x1_71: integer) → error_empty ⟨ ⟨#{☛ } true ⊢ ⟨x1_71 +! 1⟩⟩ | false ⊢ ∅ ⟩) in let f_72 : integer → integer = #{≔ RentComputation.f} (λ (x1_73: integer) → error_empty ⟨ ⟨#{☛ } true ⊢ ⟨#{← RentComputation.g} #{≔ RentComputation.g.output} (#{→ RentComputation.g} g_70) #{≔ RentComputation.g.input0} (x1_73 +! 1)⟩⟩ | false ⊢ ∅ ⟩) in { RentComputation f = f_72; })) #{≔ RentComputation.direct.input} {RentComputation_in} in let result1_74 : RentComputation = { RentComputation f = λ (param0_75: integer) → #{← RentComputation.f} #{≔ RentComputation.f.output} (#{→ RentComputation.f} result_68.f) #{≔ RentComputation.f.input0} param0_75; } in #{← RentComputation.direct} #{≔ RentComputation.direct.output} if #{☛ RentComputation.direct.output} true then result1_74 else result1_74).f x_67⟩⟩ | false ⊢ ∅ ⟩ [LOG] ☛ Definition applied: - ┌─⯈ tests/scope/good/scope_call3.catala_en:8.14-8.20: - └─┐ + ─➤ tests/scope/good/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/scope/good/scope_call3.catala_en:7.14-7.15: - └─┐ + ─➤ tests/scope/good/scope_call3.catala_en:7.14-7.15: + │ 7 │ definition f of x equals (output of RentComputation).f of x │ ‾ [LOG] → RentComputation.direct @@ -58,8 +62,8 @@ $ catala Interpret -t -s HousingComputation --debug [LOG] ≔ RentComputation.g: λ (x_76: integer) → error_empty ⟨ ⟨#{☛ } true ⊢ ⟨x_76 +! 1⟩⟩ | false ⊢ ∅ ⟩ [LOG] ≔ RentComputation.f: λ (x_77: integer) → error_empty ⟨ ⟨#{☛ } true ⊢ ⟨#{← RentComputation.g} #{≔ RentComputation.g.output} (#{→ RentComputation.g} (λ (x1_78: integer) → error_empty ⟨ ⟨#{☛ } true ⊢ ⟨x1_78 +! 1⟩⟩ | false ⊢ ∅ ⟩)) #{≔ RentComputation.g.input0} (x_77 +! 1)⟩⟩ | false ⊢ ∅ ⟩ [LOG] ☛ Definition applied: - ┌─⯈ tests/scope/good/scope_call3.catala_en:7.29-7.54: - └─┐ + ─➤ tests/scope/good/scope_call3.catala_en:7.29-7.54: + │ 7 │ definition f of x equals (output of RentComputation).f of x │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ [LOG] ≔ RentComputation.direct.output: { RentComputation f = λ (param0_79: integer) → #{← RentComputation.f} #{≔ RentComputation.f.output} (#{→ RentComputation.f} { RentComputation f = λ (x_80: integer) → error_empty ⟨ ⟨#{☛ } true ⊢ ⟨#{← RentComputation.g} #{≔ RentComputation.g.output} (#{→ RentComputation.g} (λ (x1_81: integer) → error_empty ⟨ ⟨#{☛ } true ⊢ ⟨x1_81 +! 1⟩⟩ | false ⊢ ∅ ⟩)) #{≔ RentComputation.g.input0} (x_80 +! 1)⟩⟩ | false ⊢ ∅ ⟩; }.f) #{≔ RentComputation.f.input0} param0_79; } @@ -67,15 +71,15 @@ $ catala Interpret -t -s HousingComputation --debug [LOG] → RentComputation.f [LOG] ≔ RentComputation.f.input0: 1 [LOG] ☛ Definition applied: - ┌─⯈ tests/scope/good/scope_call3.catala_en:16.14-16.15: - └──┐ + ─➤ tests/scope/good/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/scope/good/scope_call3.catala_en:15.14-15.15: - └──┐ + ─➤ tests/scope/good/scope_call3.catala_en:15.14-15.15: + │ 15 │ definition g of x equals x + 1 │ ‾ [LOG] ≔ RentComputation.g.output: 3 @@ -86,30 +90,30 @@ $ catala Interpret -t -s HousingComputation --debug [LOG] ← HousingComputation.f [LOG] ≔ HousingComputation.result: 3 [DEBUG] End of interpretation -[RESULT] Computation successful! Results: -[RESULT] -f = λ (x: integer) → - error_empty - ⟨ ⟨true - ⊢ ⟨(let result : RentComputation = - (λ (RentComputation_in: RentComputation_in) → - let g : integer → integer = - λ (x1: integer) → - error_empty ⟨ ⟨true ⊢ ⟨x1 + 1⟩⟩ | false ⊢ ∅ ⟩ - in - let f : integer → integer = - λ (x1: integer) → - error_empty ⟨ ⟨true ⊢ ⟨g (x1 + 1)⟩⟩ | false ⊢ ∅ ⟩ - in - { RentComputation f = f; }) - {RentComputation_in} - in - let result1 : RentComputation = - { RentComputation f = λ (param0: integer) → result.f param0; } - in - if true then result1 else result1). - f - x⟩⟩ - | false ⊢ ∅ ⟩ -[RESULT] result = 3 +┌─[RESULT]─ +│ f = λ (x: integer) → +│ error_empty +│ ⟨ ⟨true +│ ⊢ ⟨(let result : RentComputation = +│ (λ (RentComputation_in: RentComputation_in) → +│ let g : integer → integer = +│ λ (x1: integer) → +│ error_empty ⟨ ⟨true ⊢ ⟨x1 + 1⟩⟩ | false ⊢ ∅ ⟩ +│ in +│ let f : integer → integer = +│ λ (x1: integer) → +│ error_empty ⟨ ⟨true ⊢ ⟨g (x1 + 1)⟩⟩ | false ⊢ ∅ ⟩ +│ in +│ { RentComputation f = f; }) +│ {RentComputation_in} +│ in +│ let result1 : RentComputation = +│ { RentComputation f = λ (param0: integer) → result.f param0; } +│ in +│ if true then result1 else result1). +│ f +│ x⟩⟩ +│ | false ⊢ ∅ ⟩ +│ result = 3 +└─ ``` diff --git a/tests/scope/good/scope_call4.catala_en b/tests/scope/good/scope_call4.catala_en index 628585ed7..e9fb67f05 100644 --- a/tests/scope/good/scope_call4.catala_en +++ b/tests/scope/good/scope_call4.catala_en @@ -26,8 +26,12 @@ scope RentComputation: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline @@ -47,21 +51,20 @@ $ catala interpret -s RentComputation --debug [DEBUG] Typechecking again... [DEBUG] Starting interpretation... [DEBUG] End of interpretation -[RESULT] Computation successful! Results: -[RESULT] -f1 = λ (x: integer) → - error_empty - ⟨ ⟨true - ⊢ ⟨let x1 : integer = x + 1 in - error_empty ⟨ ⟨true ⊢ ⟨x1 + 1⟩⟩ | false ⊢ ∅ ⟩⟩⟩ - | false ⊢ ∅ ⟩ -[RESULT] -f2 = λ (x: integer) → - error_empty - ⟨ ⟨true - ⊢ ⟨let x1 : integer = x + 1 in - error_empty ⟨ ⟨true ⊢ ⟨x1 + 1⟩⟩ | false ⊢ ∅ ⟩⟩⟩ - | false ⊢ ∅ ⟩ +┌─[RESULT]─ +│ f1 = λ (x: integer) → +│ error_empty +│ ⟨ ⟨true +│ ⊢ ⟨let x1 : integer = x + 1 in +│ error_empty ⟨ ⟨true ⊢ ⟨x1 + 1⟩⟩ | false ⊢ ∅ ⟩⟩⟩ +│ | false ⊢ ∅ ⟩ +│ f2 = λ (x: integer) → +│ error_empty +│ ⟨ ⟨true +│ ⊢ ⟨let x1 : integer = x + 1 in +│ error_empty ⟨ ⟨true ⊢ ⟨x1 + 1⟩⟩ | false ⊢ ∅ ⟩⟩⟩ +│ | false ⊢ ∅ ⟩ +└─ ``` ```catala-test-inline @@ -85,9 +88,10 @@ $ catala Interpret --lcalc -s RentComputation --avoid-exceptions --optimize --de [DEBUG] Retyping lambda calculus... [DEBUG] Starting interpretation... [DEBUG] End of interpretation -[RESULT] Computation successful! Results: -[RESULT] f1 = λ (x: integer) → let x1 : integer = x + 1 in - ((x1 + 1)) -[RESULT] f2 = λ (x: integer) → let x1 : integer = x + 1 in - ((x1 + 1)) +┌─[RESULT]─ +│ f1 = λ (x: integer) → let x1 : integer = x + 1 in +│ ((x1 + 1)) +│ f2 = λ (x: integer) → let x1 : integer = x + 1 in +│ ((x1 + 1)) +└─ ``` diff --git a/tests/scope/good/scope_struct.catala_en b/tests/scope/good/scope_struct.catala_en index 639b525b1..5bb59630c 100644 --- a/tests/scope/good/scope_struct.catala_en +++ b/tests/scope/good/scope_struct.catala_en @@ -25,12 +25,17 @@ scope Foo: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope Foo -[RESULT] Computation successful! Results: -[RESULT] example = SubFoo { -- z1: 4 -- z2: 0 } +┌─[RESULT]─ +│ example = SubFoo { -- z1: 4 -- z2: 0 } +└─ ``` diff --git a/tests/scope/good/simple.catala_en b/tests/scope/good/simple.catala_en index 9907718b0..4c841d216 100644 --- a/tests/scope/good/simple.catala_en +++ b/tests/scope/good/simple.catala_en @@ -12,8 +12,12 @@ scope Foo: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline diff --git a/tests/scope/good/sub_scope.catala_en b/tests/scope/good/sub_scope.catala_en index 186c8c04b..e00ac57ad 100644 --- a/tests/scope/good/sub_scope.catala_en +++ b/tests/scope/good/sub_scope.catala_en @@ -27,21 +27,27 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] a = -1 -[RESULT] a_base = 1 -[RESULT] b = false +┌─[RESULT]─ +│ a = -1 +│ a_base = 1 +│ b = false +└─ ``` ```catala-test-inline $ catala test-scope B -[RESULT] Computation successful! Results: -[RESULT] a = 42 -[RESULT] b = true +┌─[RESULT]─ +│ a = 42 +│ b = true +└─ ``` diff --git a/tests/scope/good/sub_sub_scope.catala_en b/tests/scope/good/sub_sub_scope.catala_en index f9dacf518..93836ce1e 100644 --- a/tests/scope/good/sub_sub_scope.catala_en +++ b/tests/scope/good/sub_sub_scope.catala_en @@ -34,89 +34,112 @@ scope C: ```catala-test-inline $ catala Typecheck --check-invariants -[WARNING] Unused varible: a does not contribute to computing any of scope C - outputs. Did you forget something? - -┌─⯈ tests/scope/good/sub_sub_scope.catala_en:14.3-14.4: -└──┐ -14 │ a scope A - │ ‾ - └─ Article -[WARNING] Unused varible: b does not contribute to computing any of scope C - outputs. Did you forget something? - -┌─⯈ tests/scope/good/sub_sub_scope.catala_en:15.3-15.4: -└──┐ -15 │ b scope B - │ ‾ - └─ Article -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[WARNING]─ +│ +│ Unused varible: a does not contribute to computing any of scope C outputs. +│ Did you forget something? +│ +├─➤ tests/scope/good/sub_sub_scope.catala_en:14.3-14.4: +│ │ +│ 14 │ a scope A +│ │ ‾ +└─ Article +┌─[WARNING]─ +│ +│ Unused varible: b does not contribute to computing any of scope C outputs. +│ Did you forget something? +│ +├─➤ tests/scope/good/sub_sub_scope.catala_en:15.3-15.4: +│ │ +│ 15 │ b scope B +│ │ ‾ +└─ Article +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[WARNING] Unused varible: a does not contribute to computing any of scope C - outputs. Did you forget something? - -┌─⯈ tests/scope/good/sub_sub_scope.catala_en:14.3-14.4: -└──┐ -14 │ a scope A - │ ‾ - └─ Article -[WARNING] Unused varible: b does not contribute to computing any of scope C - outputs. Did you forget something? - -┌─⯈ tests/scope/good/sub_sub_scope.catala_en:15.3-15.4: -└──┐ -15 │ b scope B - │ ‾ - └─ Article -[RESULT] Computation successful! Results: -[RESULT] u = true -[RESULT] x = 0 +┌─[WARNING]─ +│ +│ Unused varible: a does not contribute to computing any of scope C outputs. +│ Did you forget something? +│ +├─➤ tests/scope/good/sub_sub_scope.catala_en:14.3-14.4: +│ │ +│ 14 │ a scope A +│ │ ‾ +└─ Article +┌─[WARNING]─ +│ +│ Unused varible: b does not contribute to computing any of scope C outputs. +│ Did you forget something? +│ +├─➤ tests/scope/good/sub_sub_scope.catala_en:15.3-15.4: +│ │ +│ 15 │ b scope B +│ │ ‾ +└─ Article +┌─[RESULT]─ +│ u = true +│ x = 0 +└─ ``` ```catala-test-inline $ catala test-scope B -[WARNING] Unused varible: a does not contribute to computing any of scope C - outputs. Did you forget something? - -┌─⯈ tests/scope/good/sub_sub_scope.catala_en:14.3-14.4: -└──┐ -14 │ a scope A - │ ‾ - └─ Article -[WARNING] Unused varible: b does not contribute to computing any of scope C - outputs. Did you forget something? - -┌─⯈ tests/scope/good/sub_sub_scope.catala_en:15.3-15.4: -└──┐ -15 │ b scope B - │ ‾ - └─ Article -[RESULT] Computation successful! Results: -[RESULT] y = 1 +┌─[WARNING]─ +│ +│ Unused varible: a does not contribute to computing any of scope C outputs. +│ Did you forget something? +│ +├─➤ tests/scope/good/sub_sub_scope.catala_en:14.3-14.4: +│ │ +│ 14 │ a scope A +│ │ ‾ +└─ Article +┌─[WARNING]─ +│ +│ Unused varible: b does not contribute to computing any of scope C outputs. +│ Did you forget something? +│ +├─➤ tests/scope/good/sub_sub_scope.catala_en:15.3-15.4: +│ │ +│ 15 │ b scope B +│ │ ‾ +└─ Article +┌─[RESULT]─ +│ y = 1 +└─ ``` ```catala-test-inline $ catala test-scope C -[WARNING] Unused varible: a does not contribute to computing any of scope C - outputs. Did you forget something? - -┌─⯈ tests/scope/good/sub_sub_scope.catala_en:14.3-14.4: -└──┐ -14 │ a scope A - │ ‾ - └─ Article -[WARNING] Unused varible: b does not contribute to computing any of scope C - outputs. Did you forget something? - -┌─⯈ tests/scope/good/sub_sub_scope.catala_en:15.3-15.4: -└──┐ -15 │ b scope B - │ ‾ - └─ Article -[RESULT] Computation successful! Results: -[RESULT] z = 2 +┌─[WARNING]─ +│ +│ Unused varible: a does not contribute to computing any of scope C outputs. +│ Did you forget something? +│ +├─➤ tests/scope/good/sub_sub_scope.catala_en:14.3-14.4: +│ │ +│ 14 │ a scope A +│ │ ‾ +└─ Article +┌─[WARNING]─ +│ +│ Unused varible: b does not contribute to computing any of scope C outputs. +│ Did you forget something? +│ +├─➤ tests/scope/good/sub_sub_scope.catala_en:15.3-15.4: +│ │ +│ 15 │ b scope B +│ │ ‾ +└─ Article +┌─[RESULT]─ +│ z = 2 +└─ ``` diff --git a/tests/scope/good/subscope_function_arg_not_defined.catala_en b/tests/scope/good/subscope_function_arg_not_defined.catala_en index d0ab0b165..8add58236 100644 --- a/tests/scope/good/subscope_function_arg_not_defined.catala_en +++ b/tests/scope/good/subscope_function_arg_not_defined.catala_en @@ -21,12 +21,17 @@ scope Caller: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope Caller -[RESULT] Computation successful! Results: -[RESULT] y = 1 +┌─[RESULT]─ +│ y = 1 +└─ ``` diff --git a/tests/scope/good/subscope_function_arg_not_defined2.catala_en b/tests/scope/good/subscope_function_arg_not_defined2.catala_en index 30cb9d328..6324923fd 100644 --- a/tests/scope/good/subscope_function_arg_not_defined2.catala_en +++ b/tests/scope/good/subscope_function_arg_not_defined2.catala_en @@ -23,11 +23,17 @@ scope Caller: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope Caller -[RESULT] Computation successful! +┌─[RESULT]─ +│ Computation successful! +└─ ``` diff --git a/tests/struct/bad/bug_107.catala_en b/tests/struct/bad/bug_107.catala_en index 8b04b6af5..e97950997 100644 --- a/tests/struct/bad/bug_107.catala_en +++ b/tests/struct/bad/bug_107.catala_en @@ -18,20 +18,22 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] struct name "S" already defined - -First definition: -┌─⯈ tests/struct/bad/bug_107.catala_en:4.23-4.24: -└─┐ -4 │ declaration structure S: - │ ‾ - └─ https://github.com/CatalaLang/catala/issues/107 - -Second definition: -┌─⯈ tests/struct/bad/bug_107.catala_en:8.23-8.24: -└─┐ -8 │ declaration structure S: - │ ‾ - └─ https://github.com/CatalaLang/catala/issues/107 +┌─[ERROR]─ +│ +│ struct name "S" already defined +│ +│ First definition: +├─➤ tests/struct/bad/bug_107.catala_en:4.23-4.24: +│ │ +│ 4 │ declaration structure S: +│ │ ‾ +├─ https://github.com/CatalaLang/catala/issues/107 +│ +│ Second definition: +├─➤ tests/struct/bad/bug_107.catala_en:8.23-8.24: +│ │ +│ 8 │ declaration structure S: +│ │ ‾ +└─ https://github.com/CatalaLang/catala/issues/107 #return code 123# ``` diff --git a/tests/struct/bad/empty_struct.catala_en b/tests/struct/bad/empty_struct.catala_en index de21db3e5..c305d0e07 100644 --- a/tests/struct/bad/empty_struct.catala_en +++ b/tests/struct/bad/empty_struct.catala_en @@ -9,13 +9,15 @@ declaration scope Bar: ```catala-test-inline $ catala Typecheck -[ERROR] The struct Foo does not have any fields; - give it some for Catala to be able to accept it. - -┌─⯈ tests/struct/bad/empty_struct.catala_en:4.23-4.26: -└─┐ -4 │ declaration structure Foo: - │ ‾‾‾ - └─ Test +┌─[ERROR]─ +│ +│ The struct Foo does not have any fields; +│ give it some for Catala to be able to accept it. +│ +├─➤ tests/struct/bad/empty_struct.catala_en:4.23-4.26: +│ │ +│ 4 │ declaration structure Foo: +│ │ ‾‾‾ +└─ Test #return code 123# ``` diff --git a/tests/struct/bad/nested.catala_en b/tests/struct/bad/nested.catala_en index f0bebd380..21602280e 100644 --- a/tests/struct/bad/nested.catala_en +++ b/tests/struct/bad/nested.catala_en @@ -14,21 +14,25 @@ scope A: ```catala-test-inline $ catala test-scope A -[WARNING] The constructor "Rec" of enumeration "E" is never used; - maybe it's unnecessary? - -┌─⯈ tests/struct/bad/nested.catala_en:6.6-6.9: -└─┐ -6 │ -- Rec content E - │ ‾‾‾ - └─ Article -[ERROR] The type E is defined using itself, which is not supported - (Catala does not allow recursive types) - -┌─⯈ tests/struct/bad/nested.catala_en:6.18-6.19: -└─┐ -6 │ -- Rec content E - │ ‾ - └─ Article +┌─[WARNING]─ +│ +│ The constructor "Rec" of enumeration "E" is never used; +│ maybe it's unnecessary? +│ +├─➤ tests/struct/bad/nested.catala_en:6.6-6.9: +│ │ +│ 6 │ -- Rec content E +│ │ ‾‾‾ +└─ Article +┌─[ERROR]─ +│ +│ The type E is defined using itself, which is not supported +│ (Catala does not allow recursive types) +│ +├─➤ tests/struct/bad/nested.catala_en:6.18-6.19: +│ │ +│ 6 │ -- Rec content E +│ │ ‾ +└─ Article #return code 123# ``` diff --git a/tests/struct/bad/nested2.catala_en b/tests/struct/bad/nested2.catala_en index d765a7abc..06c890e63 100644 --- a/tests/struct/bad/nested2.catala_en +++ b/tests/struct/bad/nested2.catala_en @@ -15,56 +15,64 @@ declaration scope A: ```catala-test-inline $ catala test-scope A -[WARNING] In scope "A", the variable "x" is declared but never defined; - did you forget something? - -┌─⯈ tests/struct/bad/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/struct/bad/nested2.catala_en:4.23-4.24: -└─┐ -4 │ declaration structure S: - │ ‾ - └─ Article -[WARNING] The enumeration "E" is never used; maybe it's unnecessary? - -┌─⯈ tests/struct/bad/nested2.catala_en:8.25-8.26: -└─┐ -8 │ declaration enumeration E: - │ ‾ - └─ Article -[ERROR] Cyclic dependency detected between types! - -Cycle type S, declared: -┌─⯈ tests/struct/bad/nested2.catala_en:4.23-4.24: -└─┐ -4 │ declaration structure S: - │ ‾ - └─ Article - -Used here in the definition of another cycle type E: -┌─⯈ tests/struct/bad/nested2.catala_en:10.20-10.21: -└──┐ -10 │ -- Case2 content S - │ ‾ - └─ Article - -Cycle type E, declared: -┌─⯈ tests/struct/bad/nested2.catala_en:8.25-8.26: -└─┐ -8 │ declaration enumeration E: - │ ‾ - └─ Article - -Used here in the definition of another cycle type S: -┌─⯈ tests/struct/bad/nested2.catala_en:5.18-5.19: -└─┐ -5 │ data x content E - │ ‾ - └─ Article +┌─[WARNING]─ +│ +│ In scope "A", the variable "x" is declared but never defined; +│ did you forget something? +│ +├─➤ tests/struct/bad/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/struct/bad/nested2.catala_en:4.23-4.24: +│ │ +│ 4 │ declaration structure S: +│ │ ‾ +└─ Article +┌─[WARNING]─ +│ +│ The enumeration "E" is never used; maybe it's unnecessary? +│ +├─➤ tests/struct/bad/nested2.catala_en:8.25-8.26: +│ │ +│ 8 │ declaration enumeration E: +│ │ ‾ +└─ Article +┌─[ERROR]─ +│ +│ Cyclic dependency detected between types! +│ +│ Cycle type S, declared: +├─➤ tests/struct/bad/nested2.catala_en:4.23-4.24: +│ │ +│ 4 │ declaration structure S: +│ │ ‾ +├─ Article +│ +│ Used here in the definition of another cycle type E: +├─➤ tests/struct/bad/nested2.catala_en:10.20-10.21: +│ │ +│ 10 │ -- Case2 content S +│ │ ‾ +├─ Article +│ +│ Cycle type E, declared: +├─➤ tests/struct/bad/nested2.catala_en:8.25-8.26: +│ │ +│ 8 │ declaration enumeration E: +│ │ ‾ +├─ Article +│ +│ Used here in the definition of another cycle type S: +├─➤ tests/struct/bad/nested2.catala_en:5.18-5.19: +│ │ +│ 5 │ data x content E +│ │ ‾ +└─ Article #return code 123# ``` diff --git a/tests/struct/bad/nonexisting_struct.catala_en b/tests/struct/bad/nonexisting_struct.catala_en index 223e29694..6b37fc8fa 100644 --- a/tests/struct/bad/nonexisting_struct.catala_en +++ b/tests/struct/bad/nonexisting_struct.catala_en @@ -15,12 +15,14 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] No struct named Fo found - -┌─⯈ tests/struct/bad/nonexisting_struct.catala_en:13.25-13.27: -└──┐ -13 │ definition y equals x.Fo.f - │ ‾‾ - └─ Article +┌─[ERROR]─ +│ +│ No struct named Fo found +│ +├─➤ tests/struct/bad/nonexisting_struct.catala_en:13.25-13.27: +│ │ +│ 13 │ definition y equals x.Fo.f +│ │ ‾‾ +└─ Article #return code 123# ``` diff --git a/tests/struct/bad/struct_update.catala_en b/tests/struct/bad/struct_update.catala_en index 95e775a6e..32bf879a4 100644 --- a/tests/struct/bad/struct_update.catala_en +++ b/tests/struct/bad/struct_update.catala_en @@ -20,17 +20,20 @@ scope S: ```catala-test-inline $ catala test-scope S -[ERROR] Field flx1 does not belong to structure Str - -┌─⯈ tests/struct/bad/struct_update.catala_en:17.60-17.62: -└──┐ -17 │ definition s1 equals s0 but replace { --fld1: 0 -- flx1: 99 } - │ ‾‾ - -Declaration of structure Str -┌─⯈ tests/struct/bad/struct_update.catala_en:2.23-2.26: -└─┐ -2 │ declaration structure Str: - │ ‾‾‾ +┌─[ERROR]─ +│ +│ Field flx1 does not belong to structure Str +│ +├─➤ tests/struct/bad/struct_update.catala_en:17.60-17.62: +│ │ +│ 17 │ definition s1 equals s0 but replace { --fld1: 0 -- flx1: 99 } +│ │ ‾‾ +│ +│ Declaration of structure Str +├─➤ tests/struct/bad/struct_update.catala_en:2.23-2.26: +│ │ +│ 2 │ declaration structure Str: +│ │ ‾‾‾ +└─ #return code 123# ``` diff --git a/tests/struct/bad/wrong_qualified_field.catala_en b/tests/struct/bad/wrong_qualified_field.catala_en index c1dc455b1..ceff51b66 100644 --- a/tests/struct/bad/wrong_qualified_field.catala_en +++ b/tests/struct/bad/wrong_qualified_field.catala_en @@ -19,12 +19,14 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] Field "g" does not belong to structure "Foo" (however, structure - "Bar" defines it) -┌─⯈ tests/struct/bad/wrong_qualified_field.catala_en:17.23-17.30: -└──┐ -17 │ definition y equals x.Foo.g - │ ‾‾‾‾‾‾‾ - └─ Article +┌─[ERROR]─ +│ +│ Field "g" does not belong to structure "Foo" (however, structure "Bar" +│ defines it) +├─➤ tests/struct/bad/wrong_qualified_field.catala_en:17.23-17.30: +│ │ +│17 │ definition y equals x.Foo.g +│ │ ‾‾‾‾‾‾‾ +└─ Article #return code 123# ``` diff --git a/tests/struct/good/ambiguous_fields.catala_en b/tests/struct/good/ambiguous_fields.catala_en index e866c1230..80f513b7a 100644 --- a/tests/struct/good/ambiguous_fields.catala_en +++ b/tests/struct/good/ambiguous_fields.catala_en @@ -20,26 +20,35 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[WARNING] The structure "Bar" is never used; maybe it's unnecessary? - -┌─⯈ tests/struct/good/ambiguous_fields.catala_en:7.23-7.26: -└─┐ -7 │ declaration structure Bar: - │ ‾‾‾ - └─ Article -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[WARNING]─ +│ +│ The structure "Bar" is never used; maybe it's unnecessary? +│ +├─➤ tests/struct/good/ambiguous_fields.catala_en:7.23-7.26: +│ │ +│ 7 │ declaration structure Bar: +│ │ ‾‾‾ +└─ Article +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[WARNING] The structure "Bar" is never used; maybe it's unnecessary? - -┌─⯈ tests/struct/good/ambiguous_fields.catala_en:7.23-7.26: -└─┐ -7 │ declaration structure Bar: - │ ‾‾‾ - └─ Article -[RESULT] Computation successful! Results: -[RESULT] y = 1 +┌─[WARNING]─ +│ +│ The structure "Bar" is never used; maybe it's unnecessary? +│ +├─➤ tests/struct/good/ambiguous_fields.catala_en:7.23-7.26: +│ │ +│ 7 │ declaration structure Bar: +│ │ ‾‾‾ +└─ Article +┌─[RESULT]─ +│ y = 1 +└─ ``` diff --git a/tests/struct/good/nested3.catala_en b/tests/struct/good/nested3.catala_en index 3a3dca5ea..8f82bf2c4 100644 --- a/tests/struct/good/nested3.catala_en +++ b/tests/struct/good/nested3.catala_en @@ -38,21 +38,25 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] -t = T { -- a: S { -- x: 0 -- y: false } -- b: S { -- x: 1 -- y: true } } +┌─[RESULT]─ +│ t = T { -- a: S { -- x: 0 -- y: false } -- b: S { -- x: 1 -- y: true } } +└─ ``` ```catala-test-inline $ catala test-scope B -[RESULT] Computation successful! Results: -[RESULT] out = 1 -[RESULT] -t = T { -- a: S { -- x: 0 -- y: false } -- b: S { -- x: 1 -- y: true } } +┌─[RESULT]─ +│ out = 1 +│ t = T { -- a: S { -- x: 0 -- y: false } -- b: S { -- x: 1 -- y: true } } +└─ ``` diff --git a/tests/struct/good/same_name_fields.catala_en b/tests/struct/good/same_name_fields.catala_en index dbef5f4eb..9b6909d40 100644 --- a/tests/struct/good/same_name_fields.catala_en +++ b/tests/struct/good/same_name_fields.catala_en @@ -20,27 +20,36 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[WARNING] The structure "Bar" is never used; maybe it's unnecessary? - -┌─⯈ tests/struct/good/same_name_fields.catala_en:7.23-7.26: -└─┐ -7 │ declaration structure Bar: - │ ‾‾‾ - └─ Article -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[WARNING]─ +│ +│ The structure "Bar" is never used; maybe it's unnecessary? +│ +├─➤ tests/struct/good/same_name_fields.catala_en:7.23-7.26: +│ │ +│ 7 │ declaration structure Bar: +│ │ ‾‾‾ +└─ Article +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[WARNING] The structure "Bar" is never used; maybe it's unnecessary? - -┌─⯈ tests/struct/good/same_name_fields.catala_en:7.23-7.26: -└─┐ -7 │ declaration structure Bar: - │ ‾‾‾ - └─ Article -[RESULT] Computation successful! Results: -[RESULT] x = Foo { -- f: 1 } -[RESULT] y = 1 +┌─[WARNING]─ +│ +│ The structure "Bar" is never used; maybe it's unnecessary? +│ +├─➤ tests/struct/good/same_name_fields.catala_en:7.23-7.26: +│ │ +│ 7 │ declaration structure Bar: +│ │ ‾‾‾ +└─ Article +┌─[RESULT]─ +│ x = Foo { -- f: 1 } +│ y = 1 +└─ ``` diff --git a/tests/struct/good/simple.catala_en b/tests/struct/good/simple.catala_en index 7dab98f3f..5695498da 100644 --- a/tests/struct/good/simple.catala_en +++ b/tests/struct/good/simple.catala_en @@ -21,13 +21,18 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] s = S { -- x: 1 -- y: 2 } -[RESULT] z = 3 +┌─[RESULT]─ +│ s = S { -- x: 1 -- y: 2 } +│ z = 3 +└─ ``` diff --git a/tests/struct/good/struct_update.catala_en b/tests/struct/good/struct_update.catala_en index c0df02a3c..98a79380a 100644 --- a/tests/struct/good/struct_update.catala_en +++ b/tests/struct/good/struct_update.catala_en @@ -32,16 +32,20 @@ scope S: ```catala-test-inline $ catala test-scope S -[WARNING] All fields of Str are rewritten in this replacement. - -┌─⯈ tests/struct/good/struct_update.catala_en:25.24-25.91: -└──┐ -25 │ definition s4 equals s3 but replace { -- fld1: 100 -- fld2: $100 -- fld3: |2100-01-01| } - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -[RESULT] Computation successful! Results: -[RESULT] s1 = Str { -- fld1: 99 -- fld2: $1.00 -- fld3: 2003-01-01 } -[RESULT] s2 = Str { -- fld1: 0 -- fld2: $99.00 -- fld3: 2003-01-01 } -[RESULT] s3 = Str { -- fld1: 99 -- fld2: $99.00 -- fld3: 2099-01-01 } -[RESULT] s4 = Str { -- fld1: 100 -- fld2: $100.00 -- fld3: 2100-01-01 } -[RESULT] s5 = Str { -- fld1: 100 -- fld2: $99.00 -- fld3: 2100-01-01 } +┌─[WARNING]─ +│ +│ All fields of Str are rewritten in this replacement. +│ +├─➤ tests/struct/good/struct_update.catala_en:25.24-25.91: +│ │ +│ 25 │ definition s4 equals s3 but replace { -- fld1: 100 -- fld2: $100 -- fld3: |2100-01-01| } +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +└─ +┌─[RESULT]─ +│ s1 = Str { -- fld1: 99 -- fld2: $1.00 -- fld3: 2003-01-01 } +│ s2 = Str { -- fld1: 0 -- fld2: $99.00 -- fld3: 2003-01-01 } +│ s3 = Str { -- fld1: 99 -- fld2: $99.00 -- fld3: 2099-01-01 } +│ s4 = Str { -- fld1: 100 -- fld2: $100.00 -- fld3: 2100-01-01 } +│ s5 = Str { -- fld1: 100 -- fld2: $99.00 -- fld3: 2100-01-01 } +└─ ``` diff --git a/tests/tuples/good/tuples.catala_en b/tests/tuples/good/tuples.catala_en index 541770c88..f7d094fb1 100644 --- a/tests/tuples/good/tuples.catala_en +++ b/tests/tuples/good/tuples.catala_en @@ -33,12 +33,17 @@ scope Test: ```catala-test-inline $ catala typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope Test -[RESULT] Computation successful! Results: -[RESULT] o = (2001-01-03, 6.0) +┌─[RESULT]─ +│ o = (2001-01-03, 6.0) +└─ ``` diff --git a/tests/tuples/good/tuplists.catala_en b/tests/tuples/good/tuplists.catala_en index 97f6d18ee..1d35971ea 100644 --- a/tests/tuples/good/tuplists.catala_en +++ b/tests/tuples/good/tuplists.catala_en @@ -43,54 +43,51 @@ scope S: ```catala-test-inline $ catala typecheck -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope S -[RESULT] Computation successful! Results: -[RESULT] -r1 = - [ - ($120.00, 0.5); ($13.00, 0.005); ($1,400.00, 10.0); - ($630.00, 1.826,086,956,521,739,130,4…); ($272.00, 0.68); - ($170.00, 0.833,333,333,333,333,333,33…) - ] -[RESULT] -r2 = - [ - ($120.00, 0.5); ($13.00, 0.005); ($1,400.00, 10.0); - ($630.00, 1.826,086,956,521,739,130,4…); ($272.00, 0.68); - ($170.00, 0.833,333,333,333,333,333,33…) - ] -[RESULT] -r3 = - [ - ($120.00, 0.5); ($13.00, 0.005); ($1,400.00, 10.0); - ($630.00, 1.826,086,956,521,739,130,4…); ($272.00, 0.68); - ($170.00, 0.833,333,333,333,333,333,33…) - ] -[RESULT] -r4 = - [ - ($120.00, 0.5); ($13.00, 0.005); ($1,400.00, 10.0); - ($630.00, 1.826,086,956,521,739,130,4…); ($272.00, 0.68); - ($170.00, 0.833,333,333,333,333,333,33…) - ] -[RESULT] -r5 = - [ - ($120.00, 0.5); ($13.00, 0.005); ($1,400.00, 10.0); - ($630.00, 1.826,086,956,521,739,130,4…); ($272.00, 0.68); - ($170.00, 0.833,333,333,333,333,333,33…) - ] -[RESULT] -r6 = - [ - ($120.00, 0.5); ($13.00, 0.005); ($1,400.00, 10.0); - ($630.00, 1.826,086,956,521,739,130,4…); ($272.00, 0.68); - ($170.00, 0.833,333,333,333,333,333,33…) - ] +┌─[RESULT]─ +│ r1 = +│ [ +│ ($120.00, 0.5); ($13.00, 0.005); ($1,400.00, 10.0); +│ ($630.00, 1.826,086,956,521,739,130,4…); ($272.00, 0.68); +│ ($170.00, 0.833,333,333,333,333,333,33…) +│ ] +│ r2 = +│ [ +│ ($120.00, 0.5); ($13.00, 0.005); ($1,400.00, 10.0); +│ ($630.00, 1.826,086,956,521,739,130,4…); ($272.00, 0.68); +│ ($170.00, 0.833,333,333,333,333,333,33…) +│ ] +│ r3 = +│ [ +│ ($120.00, 0.5); ($13.00, 0.005); ($1,400.00, 10.0); +│ ($630.00, 1.826,086,956,521,739,130,4…); ($272.00, 0.68); +│ ($170.00, 0.833,333,333,333,333,333,33…) +│ ] +│ r4 = +│ [ +│ ($120.00, 0.5); ($13.00, 0.005); ($1,400.00, 10.0); +│ ($630.00, 1.826,086,956,521,739,130,4…); ($272.00, 0.68); +│ ($170.00, 0.833,333,333,333,333,333,33…) +│ ] +│ r5 = +│ [ +│ ($120.00, 0.5); ($13.00, 0.005); ($1,400.00, 10.0); +│ ($630.00, 1.826,086,956,521,739,130,4…); ($272.00, 0.68); +│ ($170.00, 0.833,333,333,333,333,333,33…) +│ ] +│ r6 = +│ [ +│ ($120.00, 0.5); ($13.00, 0.005); ($1,400.00, 10.0); +│ ($630.00, 1.826,086,956,521,739,130,4…); ($272.00, 0.68); +│ ($170.00, 0.833,333,333,333,333,333,33…) +│ ] +└─ ``` ```catala-test-inline diff --git a/tests/typing/bad/err1.catala_en b/tests/typing/bad/err1.catala_en index 64fe1ffff..e9c1a32ac 100644 --- a/tests/typing/bad/err1.catala_en +++ b/tests/typing/bad/err1.catala_en @@ -12,20 +12,23 @@ scope S: ```catala-test-inline $ catala Typecheck -[ERROR] Error during typechecking, incompatible types: - ┌─⯈ decimal - └─⯈ integer - -This expression has type decimal: -┌─⯈ tests/typing/bad/err1.catala_en:7.23-7.26: -└─┐ -7 │ Structure { -- i: 4.1 -- e: y }; - │ ‾‾‾ - -Expected type integer coming from expression: -┌─⯈ tests/typing/bad/common.catala_en:8.18-8.25: -└─┐ -8 │ data i content integer - │ ‾‾‾‾‾‾‾ +┌─[ERROR]─ +│ +│ Error during typechecking, incompatible types: +│ ─➤ decimal +│ ─➤ integer +│ +│ This expression has type decimal: +├─➤ tests/typing/bad/err1.catala_en:7.23-7.26: +│ │ +│ 7 │ Structure { -- i: 4.1 -- e: y }; +│ │ ‾‾‾ +│ +│ Expected type integer coming from expression: +├─➤ tests/typing/bad/common.catala_en:8.18-8.25: +│ │ +│ 8 │ data i content integer +│ │ ‾‾‾‾‾‾‾ +└─ #return code 123# ``` diff --git a/tests/typing/bad/err2.catala_en b/tests/typing/bad/err2.catala_en index 3411a6865..f088f255b 100644 --- a/tests/typing/bad/err2.catala_en +++ b/tests/typing/bad/err2.catala_en @@ -12,20 +12,23 @@ scope S: ```catala-test-inline $ catala Typecheck -[ERROR] Error during typechecking, incompatible types: - ┌─⯈ decimal - └─⯈ list - -This expression has type decimal: -┌─⯈ tests/typing/bad/err2.catala_en:10.39-10.42: -└──┐ -10 │ definition a equals number of (z ++ 1.1) / 2 - │ ‾‾‾ - -Expected type list coming from expression: -┌─⯈ tests/typing/bad/err2.catala_en:10.36-10.38: -└──┐ -10 │ definition a equals number of (z ++ 1.1) / 2 - │ ‾‾ +┌─[ERROR]─ +│ +│ Error during typechecking, incompatible types: +│ ─➤ decimal +│ ─➤ list +│ +│ This expression has type decimal: +├─➤ tests/typing/bad/err2.catala_en:10.39-10.42: +│ │ +│ 10 │ definition a equals number of (z ++ 1.1) / 2 +│ │ ‾‾‾ +│ +│ Expected type list coming from expression: +├─➤ tests/typing/bad/err2.catala_en:10.36-10.38: +│ │ +│ 10 │ definition a equals number of (z ++ 1.1) / 2 +│ │ ‾‾ +└─ #return code 123# ``` diff --git a/tests/typing/bad/err3.catala_en b/tests/typing/bad/err3.catala_en index 00db4e141..849fc4f9b 100644 --- a/tests/typing/bad/err3.catala_en +++ b/tests/typing/bad/err3.catala_en @@ -12,28 +12,34 @@ scope S: ```catala-test-inline $ catala Typecheck -[WARNING] The constructor "Dec" of enumeration "Enum" is never used; - maybe it's unnecessary? - -┌─⯈ tests/typing/bad/common.catala_en:4.6-4.9: -└─┐ -4 │ -- Dec content decimal - │ ‾‾‾ -[ERROR] Error during typechecking, incompatible types: - ┌─⯈ integer - └─⯈ decimal - -This expression has type integer: -┌─⯈ tests/typing/bad/err3.catala_en:10.23-10.45: -└──┐ -10 │ definition a equals number of (z ++ z) * 2 - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - -Expected type decimal coming from expression: -┌─⯈ tests/typing/bad/common.catala_en:15.20-15.27: -└──┐ -15 │ output a content decimal - │ ‾‾‾‾‾‾‾ +┌─[WARNING]─ +│ +│ The constructor "Dec" of enumeration "Enum" is never used; +│ maybe it's unnecessary? +│ +├─➤ tests/typing/bad/common.catala_en:4.6-4.9: +│ │ +│ 4 │ -- Dec content decimal +│ │ ‾‾‾ +└─ +┌─[ERROR]─ +│ +│ Error during typechecking, incompatible types: +│ ─➤ integer +│ ─➤ decimal +│ +│ This expression has type integer: +├─➤ tests/typing/bad/err3.catala_en:10.23-10.45: +│ │ +│ 10 │ definition a equals number of (z ++ z) * 2 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +│ +│ Expected type decimal coming from expression: +├─➤ tests/typing/bad/common.catala_en:15.20-15.27: +│ │ +│ 15 │ output a content decimal +│ │ ‾‾‾‾‾‾‾ +└─ #return code 123# ``` @@ -41,27 +47,33 @@ Re-putting the same check again, to ensure that the `Typecheck` and `ocaml` subc ```catala-test-inline $ catala ocaml -[WARNING] The constructor "Dec" of enumeration "Enum" is never used; - maybe it's unnecessary? - -┌─⯈ tests/typing/bad/common.catala_en:4.6-4.9: -└─┐ -4 │ -- Dec content decimal - │ ‾‾‾ -[ERROR] Error during typechecking, incompatible types: - ┌─⯈ integer - └─⯈ decimal - -This expression has type integer: -┌─⯈ tests/typing/bad/err3.catala_en:10.23-10.45: -└──┐ -10 │ definition a equals number of (z ++ z) * 2 - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - -Expected type decimal coming from expression: -┌─⯈ tests/typing/bad/common.catala_en:15.20-15.27: -└──┐ -15 │ output a content decimal - │ ‾‾‾‾‾‾‾ +┌─[WARNING]─ +│ +│ The constructor "Dec" of enumeration "Enum" is never used; +│ maybe it's unnecessary? +│ +├─➤ tests/typing/bad/common.catala_en:4.6-4.9: +│ │ +│ 4 │ -- Dec content decimal +│ │ ‾‾‾ +└─ +┌─[ERROR]─ +│ +│ Error during typechecking, incompatible types: +│ ─➤ integer +│ ─➤ decimal +│ +│ This expression has type integer: +├─➤ tests/typing/bad/err3.catala_en:10.23-10.45: +│ │ +│ 10 │ definition a equals number of (z ++ z) * 2 +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +│ +│ Expected type decimal coming from expression: +├─➤ tests/typing/bad/common.catala_en:15.20-15.27: +│ │ +│ 15 │ output a content decimal +│ │ ‾‾‾‾‾‾‾ +└─ #return code 123# ``` diff --git a/tests/typing/bad/err4.catala_en b/tests/typing/bad/err4.catala_en index b3f29ebdf..0dceb2bc4 100644 --- a/tests/typing/bad/err4.catala_en +++ b/tests/typing/bad/err4.catala_en @@ -10,40 +10,52 @@ Should be "catala Typecheck", see test err3 ```catala-test-inline $ catala ocaml -[WARNING] The structure "Structure" is never used; maybe it's unnecessary? - -┌─⯈ tests/typing/bad/common.catala_en:7.23-7.32: -└─┐ -7 │ declaration structure Structure: - │ ‾‾‾‾‾‾‾‾‾ -[WARNING] The constructor "Dec" of enumeration "Enum" is never used; - maybe it's unnecessary? - -┌─⯈ tests/typing/bad/common.catala_en:4.6-4.9: -└─┐ -4 │ -- Dec content decimal - │ ‾‾‾ -[WARNING] The constructor "Dat" of enumeration "Enum" is never used; - maybe it's unnecessary? - -┌─⯈ tests/typing/bad/common.catala_en:5.6-5.9: -└─┐ -5 │ -- Dat content date - │ ‾‾‾ -[ERROR] Error during typechecking, incompatible types: - ┌─⯈ Enum - └─⯈ Structure - -This expression has type Enum: -┌─⯈ tests/typing/bad/err4.catala_en:5.25-5.38: -└─┐ -5 │ definition z equals [ Int content x ] - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾ - -Expected type Structure coming from expression: -┌─⯈ tests/typing/bad/common.catala_en:14.28-14.37: -└──┐ -14 │ output z content list of Structure - │ ‾‾‾‾‾‾‾‾‾ +┌─[WARNING]─ +│ +│ The structure "Structure" is never used; maybe it's unnecessary? +│ +├─➤ tests/typing/bad/common.catala_en:7.23-7.32: +│ │ +│ 7 │ declaration structure Structure: +│ │ ‾‾‾‾‾‾‾‾‾ +└─ +┌─[WARNING]─ +│ +│ The constructor "Dec" of enumeration "Enum" is never used; +│ maybe it's unnecessary? +│ +├─➤ tests/typing/bad/common.catala_en:4.6-4.9: +│ │ +│ 4 │ -- Dec content decimal +│ │ ‾‾‾ +└─ +┌─[WARNING]─ +│ +│ The constructor "Dat" of enumeration "Enum" is never used; +│ maybe it's unnecessary? +│ +├─➤ tests/typing/bad/common.catala_en:5.6-5.9: +│ │ +│ 5 │ -- Dat content date +│ │ ‾‾‾ +└─ +┌─[ERROR]─ +│ +│ Error during typechecking, incompatible types: +│ ─➤ Enum +│ ─➤ Structure +│ +│ This expression has type Enum: +├─➤ tests/typing/bad/err4.catala_en:5.25-5.38: +│ │ +│ 5 │ definition z equals [ Int content x ] +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾ +│ +│ Expected type Structure coming from expression: +├─➤ tests/typing/bad/common.catala_en:14.28-14.37: +│ │ +│ 14 │ output z content list of Structure +│ │ ‾‾‾‾‾‾‾‾‾ +└─ #return code 123# ``` diff --git a/tests/typing/bad/err5.catala_en b/tests/typing/bad/err5.catala_en index add1e9fab..9c8a4d67d 100644 --- a/tests/typing/bad/err5.catala_en +++ b/tests/typing/bad/err5.catala_en @@ -12,20 +12,23 @@ scope S: ```catala-test-inline $ catala Typecheck -[ERROR] Error during typechecking, incompatible types: - ┌─⯈ integer - └─⯈ Structure - -This expression has type integer: -┌─⯈ tests/typing/bad/err5.catala_en:8.5-8.9: -└─┐ -8 │ 1040 - │ ‾‾‾‾ - -Expected type Structure coming from expression: -┌─⯈ tests/typing/bad/err5.catala_en:6.5-6.46: -└─┐ -6 │ Structure { -- i: 3 -- e: Int content x }; - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +┌─[ERROR]─ +│ +│ Error during typechecking, incompatible types: +│ ─➤ integer +│ ─➤ Structure +│ +│ This expression has type integer: +├─➤ tests/typing/bad/err5.catala_en:8.5-8.9: +│ │ +│ 8 │ 1040 +│ │ ‾‾‾‾ +│ +│ Expected type Structure coming from expression: +├─➤ tests/typing/bad/err5.catala_en:6.5-6.46: +│ │ +│ 6 │ Structure { -- i: 3 -- e: Int content x }; +│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +└─ #return code 123# ``` diff --git a/tests/typing/bad/err6.catala_en b/tests/typing/bad/err6.catala_en index f68121fcf..54ad8d956 100644 --- a/tests/typing/bad/err6.catala_en +++ b/tests/typing/bad/err6.catala_en @@ -28,20 +28,23 @@ Should be "catala Typecheck", see test err3 ```catala-test-inline $ catala ocaml -[ERROR] Error during typechecking, incompatible types: - ┌─⯈ decimal - └─⯈ integer - -This expression has type decimal: -┌─⯈ tests/typing/bad/err6.catala_en:20.27-20.30: -└──┐ -20 │ definition sub.x equals 44. - │ ‾‾‾ - -Expected type integer coming from expression: -┌─⯈ tests/typing/bad/common.catala_en:12.19-12.26: -└──┐ -12 │ input x content integer - │ ‾‾‾‾‾‾‾ +┌─[ERROR]─ +│ +│ Error during typechecking, incompatible types: +│ ─➤ decimal +│ ─➤ integer +│ +│ This expression has type decimal: +├─➤ tests/typing/bad/err6.catala_en:20.27-20.30: +│ │ +│ 20 │ definition sub.x equals 44. +│ │ ‾‾‾ +│ +│ Expected type integer coming from expression: +├─➤ tests/typing/bad/common.catala_en:12.19-12.26: +│ │ +│ 12 │ input x content integer +│ │ ‾‾‾‾‾‾‾ +└─ #return code 123# ``` diff --git a/tests/typing/good/common.catala_en b/tests/typing/good/common.catala_en index defa1e3a6..ccdf053df 100644 --- a/tests/typing/good/common.catala_en +++ b/tests/typing/good/common.catala_en @@ -19,44 +19,65 @@ declaration scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[WARNING] In scope "S", the variable "z" is declared but never defined; - did you forget something? - -┌─⯈ tests/typing/good/common.catala_en:14.10-14.11: -└──┐ -14 │ output z content list of Structure - │ ‾ -[WARNING] In scope "S", the variable "a" is declared but never defined; - did you forget something? - -┌─⯈ tests/typing/good/common.catala_en:15.10-15.11: -└──┐ -15 │ output a content decimal - │ ‾ -[WARNING] Unused varible: x does not contribute to computing any of scope S - outputs. Did you forget something? - -┌─⯈ tests/typing/good/common.catala_en:12.9-12.10: -└──┐ -12 │ input x content integer - │ ‾ -[WARNING] The structure "Structure" is never used; maybe it's unnecessary? - -┌─⯈ tests/typing/good/common.catala_en:7.23-7.32: -└─┐ -7 │ declaration structure Structure: - │ ‾‾‾‾‾‾‾‾‾ -[WARNING] The enumeration "Enum" is never used; maybe it's unnecessary? - -┌─⯈ tests/typing/good/common.catala_en:2.25-2.29: -└─┐ -2 │ declaration enumeration Enum: - │ ‾‾‾‾ -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[WARNING]─ +│ +│ In scope "S", the variable "z" is declared but never defined; +│ did you forget something? +│ +├─➤ tests/typing/good/common.catala_en:14.10-14.11: +│ │ +│ 14 │ output z content list of Structure +│ │ ‾ +└─ +┌─[WARNING]─ +│ +│ In scope "S", the variable "a" is declared but never defined; +│ did you forget something? +│ +├─➤ tests/typing/good/common.catala_en:15.10-15.11: +│ │ +│ 15 │ output a content decimal +│ │ ‾ +└─ +┌─[WARNING]─ +│ +│ Unused varible: x does not contribute to computing any of scope S outputs. +│ Did you forget something? +│ +├─➤ tests/typing/good/common.catala_en:12.9-12.10: +│ │ +│ 12 │ input x content integer +│ │ ‾ +└─ +┌─[WARNING]─ +│ +│ The structure "Structure" is never used; maybe it's unnecessary? +│ +├─➤ tests/typing/good/common.catala_en:7.23-7.32: +│ │ +│ 7 │ declaration structure Structure: +│ │ ‾‾‾‾‾‾‾‾‾ +└─ +┌─[WARNING]─ +│ +│ The enumeration "Enum" is never used; maybe it's unnecessary? +│ +├─➤ tests/typing/good/common.catala_en:2.25-2.29: +│ │ +│ 2 │ declaration enumeration Enum: +│ │ ‾‾‾‾ +└─ +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala Typecheck --disable-warning -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` diff --git a/tests/typing/good/overload.catala_en b/tests/typing/good/overload.catala_en index 0dad59645..d4910b3a9 100644 --- a/tests/typing/good/overload.catala_en +++ b/tests/typing/good/overload.catala_en @@ -61,17 +61,22 @@ scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope S -[RESULT] Computation successful! Results: -[RESULT] o_b = true -[RESULT] o_d = [-13 days] -[RESULT] o_i = -5 -[RESULT] o_m = -$5.75 -[RESULT] o_t = 2022-01-24 -[RESULT] o_x = 0.142,857,142,857,142,857,14… +┌─[RESULT]─ +│ o_b = true +│ o_d = [-13 days] +│ o_i = -5 +│ o_m = -$5.75 +│ o_t = 2022-01-24 +│ o_x = 0.142,857,142,857,142,857,14… +└─ ``` diff --git a/tests/variable_state/bad/def_no_state.catala_en b/tests/variable_state/bad/def_no_state.catala_en index 22c5fc332..f29a42860 100644 --- a/tests/variable_state/bad/def_no_state.catala_en +++ b/tests/variable_state/bad/def_no_state.catala_en @@ -12,20 +12,22 @@ scope A: ```catala-test-inline $ catala Typecheck -[ERROR] This definition does not indicate which state has to be considered - for variable foo. - -┌─⯈ tests/variable_state/bad/def_no_state.catala_en:10.14-10.17: -└──┐ -10 │ definition foo equals 2 - │ ‾‾‾ - └─ Test - -Variable declaration: -┌─⯈ tests/variable_state/bad/def_no_state.catala_en:5.10-5.13: -└─┐ -5 │ output foo content integer - │ ‾‾‾ - └─ Test +┌─[ERROR]─ +│ +│ This definition does not indicate which state has to be considered for +│ variable foo. +│ +├─➤ tests/variable_state/bad/def_no_state.catala_en:10.14-10.17: +│ │ +│ 10 │ definition foo equals 2 +│ │ ‾‾‾ +├─ Test +│ +│ Variable declaration: +├─➤ tests/variable_state/bad/def_no_state.catala_en:5.10-5.13: +│ │ +│ 5 │ output foo content integer +│ │ ‾‾‾ +└─ Test #return code 123# ``` diff --git a/tests/variable_state/bad/double_same_state.catala_en b/tests/variable_state/bad/double_same_state.catala_en index 8492354a3..47bedd8c2 100644 --- a/tests/variable_state/bad/double_same_state.catala_en +++ b/tests/variable_state/bad/double_same_state.catala_en @@ -12,21 +12,23 @@ scope A: ```catala-test-inline $ catala Typecheck -[ERROR] There are two states with the same name for the same variable: this - is ambiguous. Please change the name of either states. - -First instance of state "bar": -┌─⯈ tests/variable_state/bad/double_same_state.catala_en:6.11-6.14: -└─┐ -6 │ state bar - │ ‾‾‾ - └─ Test - -Second instance of state "bar": -┌─⯈ tests/variable_state/bad/double_same_state.catala_en:7.11-7.14: -└─┐ -7 │ state bar - │ ‾‾‾ - └─ Test +┌─[ERROR]─ +│ +│ There are two states with the same name for the same variable: this is +│ ambiguous. Please change the name of either states. +│ +│ First instance of state "bar": +├─➤ tests/variable_state/bad/double_same_state.catala_en:6.11-6.14: +│ │ +│ 6 │ state bar +│ │ ‾‾‾ +├─ Test +│ +│ Second instance of state "bar": +├─➤ tests/variable_state/bad/double_same_state.catala_en:7.11-7.14: +│ │ +│ 7 │ state bar +│ │ ‾‾‾ +└─ Test #return code 123# ``` diff --git a/tests/variable_state/bad/no_cross_exceptions.catala_en b/tests/variable_state/bad/no_cross_exceptions.catala_en index 338285da1..38c326d60 100644 --- a/tests/variable_state/bad/no_cross_exceptions.catala_en +++ b/tests/variable_state/bad/no_cross_exceptions.catala_en @@ -16,12 +16,14 @@ scope A: ```catala-test-inline $ catala Typecheck -[ERROR] Unknown label for the scope variable foo@baz: "thing" - -┌─⯈ tests/variable_state/bad/no_cross_exceptions.catala_en:14.13-14.18: -└──┐ -14 │ exception thing definition foo state baz under condition true consequence equals 3 - │ ‾‾‾‾‾ - └─ Test +┌─[ERROR]─ +│ +│ Unknown label for the scope variable foo@baz: "thing" +│ +├─➤ tests/variable_state/bad/no_cross_exceptions.catala_en:14.13-14.18: +│ │ +│ 14 │ exception thing definition foo state baz under condition true consequence equals 3 +│ │ ‾‾‾‾‾ +└─ Test #return code 123# ``` diff --git a/tests/variable_state/bad/self_reference_first_state.catala_en b/tests/variable_state/bad/self_reference_first_state.catala_en index 9b0bde656..1fc8a92da 100644 --- a/tests/variable_state/bad/self_reference_first_state.catala_en +++ b/tests/variable_state/bad/self_reference_first_state.catala_en @@ -14,13 +14,14 @@ scope A: ```catala-test-inline $ catala Typecheck -[ERROR] The definition of the initial state of this variable refers to - itself. - -┌─⯈ tests/variable_state/bad/self_reference_first_state.catala_en:10.35-10.38: -└──┐ -10 │ definition foo state bar equals foo + 1 - │ ‾‾‾ - └─ Test +┌─[ERROR]─ +│ +│ The definition of the initial state of this variable refers to itself. +│ +├─➤ tests/variable_state/bad/self_reference_first_state.catala_en:10.35-10.38: +│ │ +│ 10 │ definition foo state bar equals foo + 1 +│ │ ‾‾‾ +└─ Test #return code 123# ``` diff --git a/tests/variable_state/bad/state_cycle.catala_en b/tests/variable_state/bad/state_cycle.catala_en index d41185896..2ecd73bb2 100644 --- a/tests/variable_state/bad/state_cycle.catala_en +++ b/tests/variable_state/bad/state_cycle.catala_en @@ -21,35 +21,37 @@ scope A: ```catala-test-inline $ catala Typecheck -[ERROR] Cyclic dependency detected between the following variables of scope A: - foofoo@bar → foofoo@baz → foo@bar → foo@baz → foofoo@bar - -foofoo@bar is used here in the definition of foofoo@baz: -┌─⯈ tests/variable_state/bad/state_cycle.catala_en:19.38-19.44: -└──┐ -19 │ definition foofoo state baz equals foofoo + 1 - │ ‾‾‾‾‾‾ - └─ Test - -foofoo@baz is used here in the definition of foo@bar: -┌─⯈ tests/variable_state/bad/state_cycle.catala_en:13.35-13.41: -└──┐ -13 │ definition foo state bar equals foofoo - │ ‾‾‾‾‾‾ - └─ Test - -foo@bar is used here in the definition of foo@baz: -┌─⯈ tests/variable_state/bad/state_cycle.catala_en:15.35-15.38: -└──┐ -15 │ definition foo state baz equals foo + 1 - │ ‾‾‾ - └─ Test - -foo@baz is used here in the definition of foofoo@bar: -┌─⯈ tests/variable_state/bad/state_cycle.catala_en:17.38-17.41: -└──┐ -17 │ definition foofoo state bar equals foo - │ ‾‾‾ - └─ Test +┌─[ERROR]─ +│ +│ Cyclic dependency detected between the following variables of scope A: +│ foofoo@bar → foofoo@baz → foo@bar → foo@baz → foofoo@bar +│ +│ foofoo@bar is used here in the definition of foofoo@baz: +├─➤ tests/variable_state/bad/state_cycle.catala_en:19.38-19.44: +│ │ +│ 19 │ definition foofoo state baz equals foofoo + 1 +│ │ ‾‾‾‾‾‾ +├─ Test +│ +│ foofoo@baz is used here in the definition of foo@bar: +├─➤ tests/variable_state/bad/state_cycle.catala_en:13.35-13.41: +│ │ +│ 13 │ definition foo state bar equals foofoo +│ │ ‾‾‾‾‾‾ +├─ Test +│ +│ foo@bar is used here in the definition of foo@baz: +├─➤ tests/variable_state/bad/state_cycle.catala_en:15.35-15.38: +│ │ +│ 15 │ definition foo state baz equals foo + 1 +│ │ ‾‾‾ +├─ Test +│ +│ foo@baz is used here in the definition of foofoo@bar: +├─➤ tests/variable_state/bad/state_cycle.catala_en:17.38-17.41: +│ │ +│ 17 │ definition foofoo state bar equals foo +│ │ ‾‾‾ +└─ Test #return code 123# ``` diff --git a/tests/variable_state/bad/unknown_state.catala_en b/tests/variable_state/bad/unknown_state.catala_en index b9f9ec023..bbb08725a 100644 --- a/tests/variable_state/bad/unknown_state.catala_en +++ b/tests/variable_state/bad/unknown_state.catala_en @@ -14,19 +14,21 @@ scope A: ```catala-test-inline $ catala Typecheck -[ERROR] This identifier is not a state declared for variable foo. - -┌─⯈ tests/variable_state/bad/unknown_state.catala_en:12.24-12.28: -└──┐ -12 │ definition foo state basz equals foo + 1 - │ ‾‾‾‾ - └─ Test - -Variable declaration: -┌─⯈ tests/variable_state/bad/unknown_state.catala_en:5.10-5.13: -└─┐ -5 │ output foo content integer - │ ‾‾‾ - └─ Test +┌─[ERROR]─ +│ +│ This identifier is not a state declared for variable foo. +│ +├─➤ tests/variable_state/bad/unknown_state.catala_en:12.24-12.28: +│ │ +│ 12 │ definition foo state basz equals foo + 1 +│ │ ‾‾‾‾ +├─ Test +│ +│ Variable declaration: +├─➤ tests/variable_state/bad/unknown_state.catala_en:5.10-5.13: +│ │ +│ 5 │ output foo content integer +│ │ ‾‾‾ +└─ Test #return code 123# ``` diff --git a/tests/variable_state/good/simple.catala_en b/tests/variable_state/good/simple.catala_en index c65b1e866..ec5d40a47 100644 --- a/tests/variable_state/good/simple.catala_en +++ b/tests/variable_state/good/simple.catala_en @@ -19,12 +19,17 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] foo = 3 +┌─[RESULT]─ +│ foo = 3 +└─ ``` diff --git a/tests/variable_state/good/state_access.catala_en b/tests/variable_state/good/state_access.catala_en index 009c7ae79..b242fd3a8 100644 --- a/tests/variable_state/good/state_access.catala_en +++ b/tests/variable_state/good/state_access.catala_en @@ -25,7 +25,8 @@ scope A: ```catala-test-inline $ catala test-scope A -[RESULT] Computation successful! Results: -[RESULT] bar = 5 -[RESULT] foo = 6 +┌─[RESULT]─ +│ bar = 5 +│ foo = 6 +└─ ``` diff --git a/tests/variable_state/good/subscope.catala_en b/tests/variable_state/good/subscope.catala_en index 785792328..cee51ef15 100644 --- a/tests/variable_state/good/subscope.catala_en +++ b/tests/variable_state/good/subscope.catala_en @@ -34,8 +34,12 @@ scope B: ```catala-test-inline $ catala Typecheck --check-invariants -[RESULT] All invariant checks passed -[RESULT] Typechecking successful! +┌─[RESULT]─ +│ All invariant checks passed +└─ +┌─[RESULT]─ +│ Typechecking successful! +└─ ``` ```catala-test-inline @@ -52,7 +56,8 @@ let scope A (foo_bar: ⟨integer⟩|context) (foo_baz: integer|internal) ```catala-test-inline $ catala test-scope B -[RESULT] Computation successful! Results: -[RESULT] foofoo = 4 -[RESULT] foofoofoo = 6 +┌─[RESULT]─ +│ foofoo = 4 +│ foofoofoo = 6 +└─ ```