aboutsummaryrefslogtreecommitdiff
path: root/tests/recurse.hgn
diff options
context:
space:
mode:
authorMathias Magnusson <mathias@magnusson.space>2025-08-04 23:12:39 +0200
committerMathias Magnusson <mathias@magnusson.space>2025-08-04 23:12:39 +0200
commit392f0c4be0d4c034a4b161337f8f3c5fbf46358a (patch)
tree493cef6315b016e8ec7f9be051be7bb904e16add /tests/recurse.hgn
parent22f24043755ed320eff8a121aa1b80ede3b3a37f (diff)
downloadhuginn-main.tar.gz
add a little test runnerHEADmain
Diffstat (limited to 'tests/recurse.hgn')
-rw-r--r--tests/recurse.hgn11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/recurse.hgn b/tests/recurse.hgn
new file mode 100644
index 0000000..bf9a0fd
--- /dev/null
+++ b/tests/recurse.hgn
@@ -0,0 +1,11 @@
+main := proc() {
+ print_up_to(read_int(0))
+ exit(0)
+}
+
+print_up_to := proc(n) {
+ print(n)
+ if n > 0 {
+ print_up_to(n - 1)
+ }
+}