Passing all tests!

This commit is contained in:
Denis Merigoux 2020-11-27 17:21:37 +01:00
parent 0443221e8b
commit ae1c2c6e02
5 changed files with 28 additions and 1 deletions

View File

@ -54,6 +54,10 @@ jobs:
run: |
eval $(opam env)
make build
- name: Run tests
run: |
eval $(opam env)
make tests
- name: Make examples
run: |

View File

@ -24,7 +24,8 @@ interpret_with_scope_and_compare =\
test_bool/test_bool.catala:
$(call interpret_with_scope_and_compare,nv,TestBool)
test_func/func.catala:
$(call interpret_with_scope,nv,S)
$(call interpret_with_scope_and_compare,nv,S)
$(call interpret_with_scope_and_compare,nv,R)
test_scope/scope.catala:
$(call interpret_with_scope_and_compare,nv,A)
test_scope/sub_scope.catala:

View File

@ -6,6 +6,10 @@ new scope S:
param x type int
param b type bool
new scope R:
param s scope S
param r type int
scope S:
def f of x1 [ (x1 >= x1) ] := x1 + x1
def f of x2 [ not b ] := x2 * x2
@ -13,4 +17,8 @@ scope S:
def b := false
def x := f of 3
scope R:
def s.f of x := x + x * x
def r := s.f of 5
*/

View File

@ -0,0 +1 @@
[RESULT] r -> 30

View File

@ -0,0 +1,13 @@
[ERROR] There is a conflict between multiple rules for assigning the same variable.
[ERROR]
[ERROR] This value is available because the justification of its definition is true:
[ERROR] --> test_func/func.catala
[ERROR] |
[ERROR] 14 | def f of x1 [ (x1 >= x1) ] := x1 + x1
[ERROR] | ^
[ERROR]
[ERROR] This value is available because the justification of its definition is true:
[ERROR] --> test_func/func.catala
[ERROR] |
[ERROR] 15 | def f of x2 [ not b ] := x2 * x2
[ERROR] | ^