Restore tests

This commit is contained in:
Denis Merigoux 2024-01-29 11:06:48 +01:00
parent b48fb0e223
commit a033f02689
No known key found for this signature in database
GPG Key ID: EE99DCFA365C3EE3
5 changed files with 353 additions and 257 deletions

File diff suppressed because it is too large Load Diff

View File

@ -22,11 +22,9 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala Lcalc --avoid-exceptions -O --closure-conversion
type Eoption = | ENone of unit | ESome of any
type S_in = { x_in: bool; }
type S = { z: integer; }
let topval closure_f : (closure_env, integer) → integer =
λ (env: closure_env) (y: integer) →
if (from_closure_env env).0 then y else - y

View File

@ -27,8 +27,7 @@ let scope S (S_in: S_in {x_in: list of integer}): S {y: integer} =
(reduce
(λ (x1: (integer * integer)) (x2: (integer * integer)) →
if x1.1 < x2.1 then x1 else x2)
let potential_max : integer = -1 in
(potential_max, potential_max)
(-1, -1)
map (λ (potential_max: integer) → (potential_max, potential_max)) x).0
in
return { S y = y; }

View File

@ -20,11 +20,9 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala Lcalc --avoid-exceptions -O --closure-conversion
type Eoption = | ENone of unit | ESome of any
type S_in = { x_in: bool; }
type S = { f: ((closure_env, integer) → integer * closure_env); }
let topval closure_f : (closure_env, integer) → integer =
λ (env: closure_env) (y: integer) →
if (from_closure_env env).0 then y else - y

View File

@ -51,30 +51,23 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala Lcalc --avoid-exceptions -O --closure-conversion
type Eoption = | ENone of unit | ESome of any
type Result = {
r: ((closure_env, integer) → integer * closure_env);
q: integer;
}
type SubFoo1_in = { x_in: integer; }
type SubFoo1 = {
x: integer;
y: ((closure_env, integer) → integer * closure_env);
}
type SubFoo2_in = { x1_in: integer; x2_in: integer; }
type SubFoo2 = {
x1: integer;
y: ((closure_env, integer) → integer * closure_env);
}
type Foo_in = { b_in: ((closure_env, unit) → eoption bool * closure_env); }
type Foo = { z: integer; }
let topval closure_y : (closure_env, integer) → integer =
λ (env: closure_env) (z: integer) →
(from_closure_env env).0 + z