aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ClientHamr/GuiLua/test.lua
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-03-20 14:32:01 +1000
committerDavid Walter Seikel2014-03-20 14:32:01 +1000
commit192dfe00ebe5d09a9d62a8cfbd8f2afb2b56d607 (patch)
tree7bb1f57fe022610d4ba5cbec2b74837bde6a340c /ClientHamr/GuiLua/test.lua
parent"Simplify" test.c. B-) (diff)
downloadSledjHamr-192dfe00ebe5d09a9d62a8cfbd8f2afb2b56d607.zip
SledjHamr-192dfe00ebe5d09a9d62a8cfbd8f2afb2b56d607.tar.gz
SledjHamr-192dfe00ebe5d09a9d62a8cfbd8f2afb2b56d607.tar.bz2
SledjHamr-192dfe00ebe5d09a9d62a8cfbd8f2afb2b56d607.tar.xz
More tests.
Diffstat (limited to 'ClientHamr/GuiLua/test.lua')
-rw-r--r--ClientHamr/GuiLua/test.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/ClientHamr/GuiLua/test.lua b/ClientHamr/GuiLua/test.lua
index fdb1448..e1e2de8 100644
--- a/ClientHamr/GuiLua/test.lua
+++ b/ClientHamr/GuiLua/test.lua
@@ -1,6 +1,5 @@
1-- Wrapping the entire module in do .. end helps if people just join a bunch of modules together, which apparently is popular. 1-- Wrapping the entire module in do .. end helps if people just join a bunch of modules together, which apparently is popular.
2-- By virtue of the fact we are stuffing our result into package.loaded[], just plain running this works as "loading the module". 2-- By virtue of the fact we are stuffing our result into package.loaded[], just plain running this works as "loading the module".
3-- TODO - Except for the "passing the name in as ..." part. B-(
4do -- Only I'm not gonna indent this. 3do -- Only I'm not gonna indent this.
5 4
6local skang = require 'skang' 5local skang = require 'skang'
@@ -35,7 +34,7 @@ skang.newParam(_M, 'bar', "Required", "Shortcut", "Default", "Help text")
35 34
36-- We can use inline functions if we don't need the function internally. 35-- We can use inline functions if we don't need the function internally.
37skang.newCommand(_M, 'func', 'number,data', 'Help Text', function (arg1, arg2) 36skang.newCommand(_M, 'func', 'number,data', 'Help Text', function (arg1, arg2)
38-- do something here 37 print('Inside test.func ' .. arg1 .. ', ' .. arg2)
39end) 38end)
40 39
41 40
@@ -48,5 +47,7 @@ end
48 47
49-- Test it. 48-- Test it.
50local skang = require 'skang' 49local skang = require 'skang'
51local test = package.loaded['test'] 50local test = require 'test'
52print('End ' .. test.bar .. ' ' .. test.VERSION .. ' ' .. skang.ThingSpace.commands.func.help) 51print('End ' .. test.bar .. ' ' .. test.VERSION .. ' ' .. skang.ThingSpace.commands.func.help)
52test.func('one', 2)
53skang.ThingSpace.commands.func.func(3, 'four')