mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-08 17:10:22 +03:00
Rewrite tests with programmative style
This commit is contained in:
parent
94ab2f4147
commit
e2879cc68d
@ -1,7 +0,0 @@
|
||||
/*
|
||||
declaration scope A:
|
||||
context x content int
|
||||
|
||||
scope A:
|
||||
def x ? true ~= 42
|
||||
*/
|
@ -1,4 +1,4 @@
|
||||
CATALA_LANG=fr
|
||||
CATALA_LANG=nv
|
||||
SRC=test_bool.catala
|
||||
|
||||
include ../Makefile.common
|
||||
|
@ -1,9 +1,10 @@
|
||||
/*
|
||||
déclaration champ d'application TestBooléen :
|
||||
contexte foo contenu booléen
|
||||
contexte bar contenu entier
|
||||
declaration scope TestBool :
|
||||
context foo content bool
|
||||
context bar content int
|
||||
|
||||
champ d'application TestBooléen :
|
||||
définition foo sous condition bar >= 0 conséquence égal à vrai
|
||||
définition foo sous condition bar < 0 conséquence égal à faux
|
||||
*/
|
||||
scope TestBool :
|
||||
def bar = 1
|
||||
def foo ? bar >= 0 ~= true
|
||||
def foo ? bar < 0 ~= false
|
||||
*/
|
||||
|
4
tests/test_scope/Makefile
Normal file
4
tests/test_scope/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
CATALA_LANG=nv
|
||||
SRC=scope.catala
|
||||
|
||||
include ../Makefile.common
|
@ -1,21 +1,21 @@
|
||||
/*
|
||||
declaration scope A:
|
||||
context a content integer
|
||||
context b content boolean
|
||||
context a_base content integer
|
||||
context a content int
|
||||
context b content bool
|
||||
context a_base content int
|
||||
|
||||
declaration scope B:
|
||||
context a content integer
|
||||
context b content boolean
|
||||
context a content int
|
||||
context b content bool
|
||||
context scopeA scope A
|
||||
|
||||
scope A:
|
||||
definition a_base equals 1
|
||||
definition a equals -1
|
||||
definition b equals a > 0
|
||||
def a_base = 1
|
||||
def a = -1
|
||||
def b = a > 0
|
||||
|
||||
scope B:
|
||||
definition a equals 42
|
||||
definition b equals scopeA.b
|
||||
definition scopeA.a under condition a > 0 consequence equals scopeA.a_base
|
||||
def a = 42
|
||||
def b = scopeA.b
|
||||
def scopeA.a ? a > 0 ~= scopeA.a_base
|
||||
*/
|
||||
|
@ -1,15 +1,15 @@
|
||||
/*
|
||||
declaration scope A:
|
||||
context a content integer
|
||||
context b content boolean
|
||||
context a content int
|
||||
context b content boo
|
||||
|
||||
declaration scope B:
|
||||
context a content integer
|
||||
context b content boolean
|
||||
context a content int
|
||||
context b content bool
|
||||
context scopeA scope A
|
||||
|
||||
declaration scope C:
|
||||
context a content integer
|
||||
context b content boolean
|
||||
context a content int
|
||||
context b content bool
|
||||
context scopeB scope B
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user