aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ClientHamr/GuiLua/test.lua
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-03-26 17:00:00 +1000
committerDavid Walter Seikel2014-03-26 17:00:00 +1000
commit92a3f00af8a5501ef5eb2cf762f0c4fc334c33dc (patch)
tree4fcf79023081f43181099748a84279788650bbf2 /ClientHamr/GuiLua/test.lua
parentWrite, use, and test isValid(). (diff)
downloadSledjHamr-92a3f00af8a5501ef5eb2cf762f0c4fc334c33dc.zip
SledjHamr-92a3f00af8a5501ef5eb2cf762f0c4fc334c33dc.tar.gz
SledjHamr-92a3f00af8a5501ef5eb2cf762f0c4fc334c33dc.tar.bz2
SledjHamr-92a3f00af8a5501ef5eb2cf762f0c4fc334c33dc.tar.xz
Test isBoolean().
Diffstat (limited to 'ClientHamr/GuiLua/test.lua')
-rw-r--r--ClientHamr/GuiLua/test.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/ClientHamr/GuiLua/test.lua b/ClientHamr/GuiLua/test.lua
index bc595fe..619e875 100644
--- a/ClientHamr/GuiLua/test.lua
+++ b/ClientHamr/GuiLua/test.lua
@@ -50,6 +50,8 @@ local test = require 'test'
50print('End ' .. test.bar .. ' ' .. test.VERSION .. ' ' .. skang.things.ffunc.help .. ' ->> ' .. skang.things.f.action) 50print('End ' .. test.bar .. ' ' .. test.VERSION .. ' ' .. skang.things.ffunc.help .. ' ->> ' .. skang.things.f.action)
51test.ffunc('one', 2) 51test.ffunc('one', 2)
52--skang.things.ffunc('seven', 'aight') 52--skang.things.ffunc('seven', 'aight')
53print('')
54
53test.f = 42 55test.f = 42
54print('f is now ' .. test.fooble .. ' ' .. test.f .. ' ' .. skang.things.f.help .. ' ' .. skang.things.fooble.help) 56print('f is now ' .. test.fooble .. ' ' .. test.f .. ' ' .. skang.things.f.help .. ' ' .. skang.things.fooble.help)
55test.f = nil 57test.f = nil
@@ -58,6 +60,27 @@ test.fooble = 42
58print('f is now ' .. test.fooble .. ' ' .. test.f) 60print('f is now ' .. test.fooble .. ' ' .. test.f)
59test.fooble = nil 61test.fooble = nil
60print('f is now ' .. test.fooble .. ' ' .. test.f) 62print('f is now ' .. test.fooble .. ' ' .. test.f)
63print('')
64
65print(skang.isBoolean(true))
66print(skang.isBoolean(1))
67print(skang.isBoolean('1'))
68print(skang.isBoolean('true'))
69print(skang.isBoolean('Yep'))
70print(skang.isBoolean('?'))
71print(skang.isBoolean(test))
72print(skang.isBoolean(function (a) return true end))
73print('')
74print(skang.isBoolean(false))
75print(skang.isBoolean(nil))
76print(skang.isBoolean(0))
77print(skang.isBoolean(''))
78print(skang.isBoolean('0'))
79print(skang.isBoolean('false'))
80print(skang.isBoolean('Nope'))
81print(skang.isBoolean(function (a) return false end))
82print('')
83
61-- First, disable the default value, so we see "is required" errors. 84-- First, disable the default value, so we see "is required" errors.
62skang.things.f.default = nil 85skang.things.f.default = nil
63test.fooble = 42 86test.fooble = 42