From eec5ae54c63be45d176d103c947d316826f16eee Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Thu, 4 May 2023 19:18:53 +0200 Subject: [PATCH] Fixed formatting -> tests update --- tests/test_bool/good/test_bool.catala_en | 12 ++---- .../good/double_definition.catala_en | 7 +--- .../good/groups_of_exceptions.catala_en | 6 +-- tests/test_io/good/all_io.catala_en | 4 +- tests/test_scope/good/scope_call3.catala_en | 40 +++++++++---------- tests/test_scope/good/scope_call4.catala_en | 10 ++--- 6 files changed, 32 insertions(+), 47 deletions(-) diff --git a/tests/test_bool/good/test_bool.catala_en b/tests/test_bool/good/test_bool.catala_en index e991b3ed..a3fcc3b1 100644 --- a/tests/test_bool/good/test_bool.catala_en +++ b/tests/test_bool/good/test_bool.catala_en @@ -17,16 +17,12 @@ let TestBool : TestBool_in → TestBool = λ (TestBool_in: TestBool_in) → let foo : unit → bool = TestBool_in.foo_in in let bar : unit → integer = TestBool_in.bar_in in - let bar1 : integer = - error_empty ⟨ bar () | true ⊢ ⟨true ⊢ 1⟩ ⟩ - in + let bar1 : integer = error_empty ⟨ bar () | true ⊢ ⟨true ⊢ 1⟩ ⟩ in let foo1 : bool = error_empty ⟨ foo () | true - ⊢ ⟨true - ⊢ ⟨ ⟨bar1 >= 0 ⊢ true⟩, ⟨bar1 < 0 ⊢ false⟩ - | false ⊢ ∅ ⟩⟩ ⟩ + ⊢ ⟨true ⊢ ⟨ ⟨bar1 >= 0 ⊢ true⟩, ⟨bar1 < 0 ⊢ false⟩ | false ⊢ ∅ ⟩⟩ ⟩ in { TestBool foo = foo1; bar = bar1; } in @@ -50,9 +46,7 @@ struct TestBool = { let scope TestBool (foo: bool|context|output) (bar: integer|context|output) = let bar : integer = reentrant or by default ⟨true ⊢ 1⟩; let foo : bool = reentrant or by default - ⟨true - ⊢ ⟨ ⟨bar >= 0 ⊢ true⟩, ⟨bar < 0 ⊢ false⟩ - | false ⊢ ∅ ⟩⟩ + ⟨true ⊢ ⟨ ⟨bar >= 0 ⊢ true⟩, ⟨bar < 0 ⊢ false⟩ | false ⊢ ∅ ⟩⟩ ``` ```catala-test-inline $ catala Interpret_Lcalc -s TestBool --avoid_exceptions --optimize diff --git a/tests/test_exception/good/double_definition.catala_en b/tests/test_exception/good/double_definition.catala_en index 99011fef..e59c5016 100644 --- a/tests/test_exception/good/double_definition.catala_en +++ b/tests/test_exception/good/double_definition.catala_en @@ -26,8 +26,7 @@ $ catala Scopelang -s Foo │ ‾‾‾‾‾‾‾‾‾‾‾‾ └─ Foo let scope Foo (x: integer|internal|output) = - let x : integer = - ⟨true ⊢ ⟨ ⟨true ⊢ 1⟩, ⟨true ⊢ 1⟩ | false ⊢ ∅ ⟩⟩ + let x : integer = ⟨true ⊢ ⟨ ⟨true ⊢ 1⟩, ⟨true ⊢ 1⟩ | false ⊢ ∅ ⟩⟩ ``` In Scopelang we have what looks like conflicting exceptions. But after @@ -53,9 +52,7 @@ $ catala Dcalc -s Foo └─ Foo let scope Foo (Foo_in: Foo_in): Foo {x: integer} = let set x : integer = - error_empty - ⟨true - ⊢ ⟨ ⟨ ⟨true ⊢ 1⟩ | true ⊢ 1 ⟩ | false ⊢ ∅ ⟩⟩ + error_empty ⟨true ⊢ ⟨ ⟨ ⟨true ⊢ 1⟩ | true ⊢ 1 ⟩ | false ⊢ ∅ ⟩⟩ in return { Foo x = x; } ``` diff --git a/tests/test_exception/good/groups_of_exceptions.catala_en b/tests/test_exception/good/groups_of_exceptions.catala_en index 746aac15..830e3a3c 100644 --- a/tests/test_exception/good/groups_of_exceptions.catala_en +++ b/tests/test_exception/good/groups_of_exceptions.catala_en @@ -39,10 +39,8 @@ struct Foo = { let scope Foo (y: integer|input) (x: integer|internal|output) = let x : integer = - ⟨ ⟨ ⟨true - ⊢ ⟨ ⟨y = 4 ⊢ 4⟩, ⟨y = 5 ⊢ 5⟩ | false ⊢ ∅ ⟩⟩ - | true - ⊢ ⟨ ⟨y = 2 ⊢ 2⟩, ⟨y = 3 ⊢ 3⟩ | false ⊢ ∅ ⟩ ⟩ + ⟨ ⟨ ⟨true ⊢ ⟨ ⟨y = 4 ⊢ 4⟩, ⟨y = 5 ⊢ 5⟩ | false ⊢ ∅ ⟩⟩ + | true ⊢ ⟨ ⟨y = 2 ⊢ 2⟩, ⟨y = 3 ⊢ 3⟩ | false ⊢ ∅ ⟩ ⟩ | true ⊢ ⟨ ⟨y = 0 ⊢ 0⟩, ⟨y = 1 ⊢ 1⟩ | false ⊢ ∅ ⟩ ⟩ ``` diff --git a/tests/test_io/good/all_io.catala_en b/tests/test_io/good/all_io.catala_en index fb09c036..43781973 100644 --- a/tests/test_io/good/all_io.catala_en +++ b/tests/test_io/good/all_io.catala_en @@ -38,9 +38,7 @@ let scope A let set e : integer = error_empty ⟨ e () | true ⊢ ⟨true ⊢ b + c + d + 1⟩ ⟩ in - let set f : integer = - error_empty ⟨ f () | true ⊢ ⟨true ⊢ e + 1⟩ ⟩ - in + let set f : integer = error_empty ⟨ f () | true ⊢ ⟨true ⊢ e + 1⟩ ⟩ in return { A b = b; d = d; f = f; } ``` diff --git a/tests/test_scope/good/scope_call3.catala_en b/tests/test_scope/good/scope_call3.catala_en index c92fb290..3ec23c08 100644 --- a/tests/test_scope/good/scope_call3.catala_en +++ b/tests/test_scope/good/scope_call3.catala_en @@ -73,25 +73,25 @@ $ catala Interpret -t -s HousingComputation error_empty ⟨true ⊢ (let result : RentComputation = - (λ (RentComputation_in: RentComputation_in) → - let g : integer → integer = - λ (x1: integer) → - error_empty ⟨true ⊢ x1 + 1⟩ - in - let f : integer → integer = - λ (x1: integer) → - error_empty ⟨true ⊢ g (x1 + 1)⟩ - 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⟩ + (λ (RentComputation_in: RentComputation_in) → + let g : integer → integer = + λ (x1: integer) → + error_empty ⟨true ⊢ x1 + 1⟩ + in + let f : integer → integer = + λ (x1: integer) → + error_empty ⟨true ⊢ g (x1 + 1)⟩ + 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⟩ [RESULT] result = 3 ``` diff --git a/tests/test_scope/good/scope_call4.catala_en b/tests/test_scope/good/scope_call4.catala_en index 8dd56c32..d9f97c02 100644 --- a/tests/test_scope/good/scope_call4.catala_en +++ b/tests/test_scope/good/scope_call4.catala_en @@ -27,14 +27,12 @@ $ catala Interpret -s RentComputation [RESULT] Computation successful! Results: [RESULT] f1 = λ (x: integer) → error_empty - ⟨true - ⊢ let x1 : integer = x + 1 in - error_empty ⟨true ⊢ x1 + 1⟩⟩ + ⟨true ⊢ let x1 : integer = x + 1 in + error_empty ⟨true ⊢ x1 + 1⟩⟩ [RESULT] f2 = λ (x: integer) → error_empty - ⟨true - ⊢ let x1 : integer = x + 1 in - error_empty ⟨true ⊢ x1 + 1⟩⟩ + ⟨true ⊢ let x1 : integer = x + 1 in + error_empty ⟨true ⊢ x1 + 1⟩⟩ ``` ```catala-test-inline