From e2879cc68da2fe18771c9eb8228d6f080732e36b Mon Sep 17 00:00:00 2001 From: Nicolas Chataing Date: Tue, 4 Aug 2020 10:30:35 +0200 Subject: [PATCH] Rewrite tests with programmative style --- tests/non_verbose.catala | 7 ------- tests/test_bool/Makefile | 2 +- tests/test_bool/test_bool.catala | 15 ++++++++------- tests/test_scope/Makefile | 4 ++++ tests/test_scope/sub_scope.catala | 22 +++++++++++----------- tests/test_scope/sub_sub_scope.catala | 12 ++++++------ 6 files changed, 30 insertions(+), 32 deletions(-) delete mode 100644 tests/non_verbose.catala create mode 100644 tests/test_scope/Makefile diff --git a/tests/non_verbose.catala b/tests/non_verbose.catala deleted file mode 100644 index 2fa49fa4..00000000 --- a/tests/non_verbose.catala +++ /dev/null @@ -1,7 +0,0 @@ -/* -declaration scope A: - context x content int - -scope A: - def x ? true ~= 42 -*/ diff --git a/tests/test_bool/Makefile b/tests/test_bool/Makefile index 296ee75a..b2fc5737 100644 --- a/tests/test_bool/Makefile +++ b/tests/test_bool/Makefile @@ -1,4 +1,4 @@ -CATALA_LANG=fr +CATALA_LANG=nv SRC=test_bool.catala include ../Makefile.common diff --git a/tests/test_bool/test_bool.catala b/tests/test_bool/test_bool.catala index f9acdba6..afdbd7e6 100644 --- a/tests/test_bool/test_bool.catala +++ b/tests/test_bool/test_bool.catala @@ -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 -*/ \ No newline at end of file +scope TestBool : + def bar = 1 + def foo ? bar >= 0 ~= true + def foo ? bar < 0 ~= false +*/ diff --git a/tests/test_scope/Makefile b/tests/test_scope/Makefile new file mode 100644 index 00000000..e195f394 --- /dev/null +++ b/tests/test_scope/Makefile @@ -0,0 +1,4 @@ +CATALA_LANG=nv +SRC=scope.catala + +include ../Makefile.common diff --git a/tests/test_scope/sub_scope.catala b/tests/test_scope/sub_scope.catala index 1d09bee1..695f0444 100644 --- a/tests/test_scope/sub_scope.catala +++ b/tests/test_scope/sub_scope.catala @@ -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 */ diff --git a/tests/test_scope/sub_sub_scope.catala b/tests/test_scope/sub_sub_scope.catala index bcf16ee0..a12e1a28 100644 --- a/tests/test_scope/sub_sub_scope.catala +++ b/tests/test_scope/sub_sub_scope.catala @@ -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 */