Rewrite tests with programmative style

This commit is contained in:
Nicolas Chataing 2020-08-04 10:30:35 +02:00
parent 94ab2f4147
commit e2879cc68d
6 changed files with 30 additions and 32 deletions

View File

@ -1,7 +0,0 @@
/*
declaration scope A:
context x content int
scope A:
def x ? true ~= 42
*/

View File

@ -1,4 +1,4 @@
CATALA_LANG=fr
CATALA_LANG=nv
SRC=test_bool.catala
include ../Makefile.common

View File

@ -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
*/

View File

@ -0,0 +1,4 @@
CATALA_LANG=nv
SRC=scope.catala
include ../Makefile.common

View File

@ -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
*/

View File

@ -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
*/