Skip to content

Commit

Permalink
test(imp) A few more tests
Browse files Browse the repository at this point in the history
Signed-off-by: Jerome Simeon <[email protected]>
  • Loading branch information
jeromesimeon committed Apr 20, 2021
1 parent 9a36716 commit a9bb00f
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,10 @@ designer_rule-test-tests-js:
--query designer_rule/test$(N).js || exit 1 ;)

## IMPEJSON
IMPEJSONTARGETS=imp_ejson wasm_ast # dnnrc_typed
IMPEJSONWASMNUM=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 18 19 20 21
# TODO 15 seems to be an error representation issue

imp_ejson-tests:
@echo "[Q*cert] "
@echo "[Q*cert] Imp (EJSON) tests"
Expand All @@ -494,10 +498,6 @@ ifneq ($(JAVASCRIPT),)
# @$(MAKE) imp_ejson-wasm-node-tests # TODO. Improve test and enable
endif

IMPEJSONTARGETS=imp_ejson wasm_ast # dnnrc_typed
IMPEJSONWASMNUM=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 18
# TODO 15 seems to be an error representation issue

# imp_ejson -> wasm ; run on spec interpreter
imp_ejson-wasm-spec-tests:
$(foreach N,$(IMPEJSONWASMNUM), \
Expand Down
9 changes: 9 additions & 0 deletions tests/imp_ejson/wasm19.imp_ejson
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* union */
module main {
wasm19(x) return y {
let input := [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0];
for(i in input) {
y := i;
}
}
}
1 change: 1 addition & 0 deletions tests/imp_ejson/wasm19.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
9 changes: 9 additions & 0 deletions tests/imp_ejson/wasm20.imp_ejson
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* union */
module main {
wasm20(x) return y {
let input := [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0];
for(i = 1 to 10) {
y := Runtime.arrayAccess(input,Runtime.natMinus(i,1));
}
}
}
1 change: 1 addition & 0 deletions tests/imp_ejson/wasm20.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
7 changes: 7 additions & 0 deletions tests/imp_ejson/wasm21.imp_ejson
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* union */
module main {
wasm21(x) return y {
let input := [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0];
y := Runtime.arrayAccess(input,9);
}
}
1 change: 1 addition & 0 deletions tests/imp_ejson/wasm21.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10

0 comments on commit a9bb00f

Please sign in to comment.