summaryrefslogtreecommitdiff
path: root/tests/params
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-03-03 17:05:28 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-03-03 17:05:28 -0500
commit2bf840925ba7781d16406ac28438f8bdc5f7d08c (patch)
treee70ca149eafd8eb4366a6ecf1edb1d4bed9e5aee /tests/params
parent0a3bb0c9ce4a2e96c7be3d0519aa0f5fa458c1af (diff)
new, better test system
Diffstat (limited to 'tests/params')
-rw-r--r--tests/params/expected15
-rw-r--r--tests/params/params.toc40
-rwxr-xr-xtests/params/test.sh3
3 files changed, 0 insertions, 58 deletions
diff --git a/tests/params/expected b/tests/params/expected
deleted file mode 100644
index 082b847..0000000
--- a/tests/params/expected
+++ /dev/null
@@ -1,15 +0,0 @@
-0
-0
-10
-21
-5
-0
-17
-0
-0
-0
-10
-21
-39
--13
--13
diff --git a/tests/params/params.toc b/tests/params/params.toc
deleted file mode 100644
index 4d37cf1..0000000
--- a/tests/params/params.toc
+++ /dev/null
@@ -1,40 +0,0 @@
-addmul ::= fn (x:=0, y:=0) add := x+y, mul := x*y {
-};
-
-do_foo ::= fn (x := 3) y := x {
- y *= 12;
- y += x;
-};
-
-puti ::= fn(x: int) {
- #C("#ifndef __TINYC__
-extern int printf(const char *fmt, ...);
-#endif
-");
- #C("printf(\"%ld\\n\", x);");
-};
-
-
-main ::= fn() {
- a, m := addmul();
- puti(a); puti(m);
- a, m = addmul(7,3);
- puti(a); puti(m);
- a, m = addmul(5);
- puti(a); puti(m);
- a, m = addmul(y = 17);
- puti(a); puti(m);
-
- c, d ::= addmul();
- puti(c); puti(d);
- e, f ::= addmul(y = 3, x = 7);
- puti(e); puti(f);
-
-
- z := do_foo();
- puti(z);
- z = do_foo(-1);
- puti(z);
- z = do_foo(x = -1);
- puti(z);
-}; \ No newline at end of file
diff --git a/tests/params/test.sh b/tests/params/test.sh
deleted file mode 100755
index 582bdec..0000000
--- a/tests/params/test.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-./params.bin > got || exit 1
-diff got expected || exit 1