aboutsummaryrefslogtreecommitdiff
path: root/test/tests/valid_snippits/call.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2017-03-13 15:38:23 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2017-03-13 15:38:23 -0400
commitf687e914e07094b1eef11d84dab2e069a9298df5 (patch)
treed74600b3afebd028689baa1c306432fac5030f9f /test/tests/valid_snippits/call.lua
parentf96040eb138efdc8f13521bade5bf8bd299bb9fb (diff)
downloadglum-f687e914e07094b1eef11d84dab2e069a9298df5.tar.gz
glum-f687e914e07094b1eef11d84dab2e069a9298df5.tar.bz2
glum-f687e914e07094b1eef11d84dab2e069a9298df5.zip
Started updateing unit tests
Diffstat (limited to 'test/tests/valid_snippits/call.lua')
-rw-r--r--test/tests/valid_snippits/call.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/tests/valid_snippits/call.lua b/test/tests/valid_snippits/call.lua
new file mode 100644
index 0000000..8549b7f
--- /dev/null
+++ b/test/tests/valid_snippits/call.lua
@@ -0,0 +1,22 @@
+
+function afunction()
+ print("You called a function!")
+end
+
+function anotherfunction(num)
+ print("Thanks, I love " .. num .. "!")
+ return num == 0 and 1 or anotherfunction(num-1)
+end
+
+local function yetanotherfunction(num)
+ print("Ew, I don't like " .. num .. ".")
+ return num <= 0 and 1 or yetanotherfunction(num/2)
+end
+
+afunction()
+
+for k = 100,1000,100 do
+ anotherfunction(k)
+end
+
+yetanotherfunction(2000)