diff options
author | Benedikt Böhm <bb@xnull.de> | 2009-07-04 11:16:49 +0200 |
---|---|---|
committer | Benedikt Böhm <bb@xnull.de> | 2009-07-04 11:16:49 +0200 |
commit | d4299c4b6f2f04f5eb8f36416f06c42e2586e7c0 (patch) | |
tree | d23c61d76e4765026757059e34e5f04ba79c4f86 /test/test1.t | |
parent | 690644bb293d7de12abddcaaca75f8f6c6dad24e (diff) | |
download | swppy-d4299c4b6f2f04f5eb8f36416f06c42e2586e7c0.tar.gz swppy-d4299c4b6f2f04f5eb8f36416f06c42e2586e7c0.tar.xz swppy-d4299c4b6f2f04f5eb8f36416f06c42e2586e7c0.zip |
add test cases
Diffstat (limited to 'test/test1.t')
-rw-r--r-- | test/test1.t | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test1.t b/test/test1.t new file mode 100644 index 0000000..1b48c0d --- /dev/null +++ b/test/test1.t @@ -0,0 +1,18 @@ +fun fib[a] + if a < 2 + @1 + end + @( call fib[a-1] + call fib[a-2] ) +end + +# main function +fun main[] + sum = 0 + i = 0 + while (i < 10) + sum = sum + call fib[i] + i = i + 1 + end + call fib[3] + @sum +end |