From 1ecf69b0e49a321a8976fd07f4a1fc91dfc55679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81ro=CC=82me=20FERET?= Date: Wed, 27 Mar 2024 20:17:56 +0100 Subject: [PATCH] fix json output and add some integration tests --- core/siteGraphs/signature.ml | 4 ++-- .../compiler/counters_smaller_than/output/inputs.ka.ref | 2 +- .../counters_smaller_than_default/output/error.log.ref | 2 +- tests/integration/compiler/site_mismatch/output/LOG.ref | 2 +- .../simulation/counters_create/output/inputs.ka.ref | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/siteGraphs/signature.ml b/core/siteGraphs/signature.ml index acb5809d9..602d1eb4e 100644 --- a/core/siteGraphs/signature.ml +++ b/core/siteGraphs/signature.ml @@ -90,7 +90,7 @@ let one_to_json = :: acc) links [])) signature.links ); - ( "counter_info", + ( "counters_info", JsonUtil.of_option (fun c -> `Assoc [ "min", JsonUtil.of_option (fun x -> `Int x) c.counter_info_min; "max", JsonUtil.of_option (fun x -> `Int x) c.counter_info_max; "default", `Int c.counter_default_value;]) signature.counters_info ); @@ -98,7 +98,7 @@ let one_to_json = let one_of_json : Yojson.Basic.t -> bool array array site_sig NamedDecls.t = NamedDecls.of_json (function - | `Assoc [ ("internal_state", a); ("links", b); ("counter_info", c) ] -> + | `Assoc [ ("internal_state", a); ("links", b); ("counters_info", c) ] -> { internal_state = NamedDecls.of_json diff --git a/tests/integration/compiler/counters_smaller_than/output/inputs.ka.ref b/tests/integration/compiler/counters_smaller_than/output/inputs.ka.ref index 836df5b98..930501e74 100644 --- a/tests/integration/compiler/counters_smaller_than/output/inputs.ka.ref +++ b/tests/integration/compiler/counters_smaller_than/output/inputs.ka.ref @@ -7,7 +7,7 @@ %def: "outputFileName" "data.csv" -%agent: A(c{=0/+=7} c__inverted{=0/+=7}) +%agent: A(c{=0/+=7} c__inverted{-=0/=7/+=7}) %agent: B() %var:/*0*/ 'B' |B()| diff --git a/tests/integration/compiler/counters_smaller_than_default/output/error.log.ref b/tests/integration/compiler/counters_smaller_than_default/output/error.log.ref index 28429451b..7e80168fc 100644 --- a/tests/integration/compiler/counters_smaller_than_default/output/error.log.ref +++ b/tests/integration/compiler/counters_smaller_than_default/output/error.log.ref @@ -8,7 +8,7 @@ _____(1) A(c{>=8}) Environment: - %agent: A(c{=0/+=7} c__inverted{=0/+=7}) + %agent: A(c{=0/+=7} c__inverted{-=0/=7/+=7}) %plot: [T] A(c{=0} c__inverted{=7})+ @ 1 diff --git a/tests/integration/compiler/site_mismatch/output/LOG.ref b/tests/integration/compiler/site_mismatch/output/LOG.ref index 28c6fc2ce..fd8f89aa7 100644 --- a/tests/integration/compiler/site_mismatch/output/LOG.ref +++ b/tests/integration/compiler/site_mismatch/output/LOG.ref @@ -73,4 +73,4 @@ every agent may occur in the model ------------------------------------------------------------ Some exceptions have been raised -error: file_name: core/KaSa_rep/frontend/prepreprocess.ml; message: line 719, File "crash.ka", line 4, characters 5-69:: missaligned rule: the rule is ignored; exception:Exit +error: file_name: core/KaSa_rep/frontend/prepreprocess.ml; message: line 752, File "crash.ka", line 4, characters 5-69:: missaligned rule: the rule is ignored; exception:Exit diff --git a/tests/integration/simulation/counters_create/output/inputs.ka.ref b/tests/integration/simulation/counters_create/output/inputs.ka.ref index 77f12712a..27872027f 100644 --- a/tests/integration/simulation/counters_create/output/inputs.ka.ref +++ b/tests/integration/simulation/counters_create/output/inputs.ka.ref @@ -7,7 +7,7 @@ %def: "outputFileName" "data.svg" -%agent: A(c{=0/+=10} c__inverted{=0/+=10}) +%agent: A(c{=0/+=10} c__inverted{-=0/=10/+=10}) %agent: B() %var:/*0*/ 'B' |B()|