Skip to content
Permalink
Browse files

test(inline) Better inlining/shadowing testing

Signed-off-by: Jerome Simeon <jeromesimeon@me.com>
  • Loading branch information...
jeromesimeon committed Jul 26, 2019
1 parent 4a8f9d4 commit f1313049f5a0ee8e5f945249739e72f8dcdd0d87
Showing with 18 additions and 6 deletions.
  1. +6 −1 examples/inlinetest/logic.ergo
  2. +5 −1 examples/inlinetest/model.cto
  3. +7 −4 packages/ergo-engine/test/workload.json
@@ -15,12 +15,17 @@
namespace org.accordproject.inline

define constant c = 1
define constant d = c

contract Smoke over TemplateModel {
clause c1(r:MyRequest) : MyResponse {
return MyResponse{
output1: let c = 2; c,
output2: foreach c in [1,2,3] return c
output2: match 2 with let c then c else 0,
output3: foreach c in [1,2,3] return c,
output4: let c = 2; d,
output5: match 2 with let c then c else 0,
output6: foreach c in [1,2,3] return d
}
}
}
@@ -19,7 +19,11 @@ transaction MyRequest {

transaction MyResponse {
o Integer output1
o Integer[] output2
o Integer output2
o Integer[] output3
o Integer output4
o Integer output5
o Integer[] output6
}

concept TemplateModel {
@@ -174,10 +174,13 @@
"contractName": "org.accordproject.smoke.Math",
"currentTime": null,
"expected": {
"response": {
"output1": 2,
"output2": [1,2,3]
}
"$class": "org.accordproject.inline.MyResponse",
"output1": 2,
"output2": 2,
"output3": [1, 2, 3],
"output4": 2,
"output5": 2,
"output6": [1, 2, 3]
}
}
]

0 comments on commit f131304

Please sign in to comment.
You can’t perform that action at this time.