summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2012-08-25 14:12:27 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2012-08-25 14:18:07 +0100
commitfe363eed4fd96c4443c4ca9ffe13c2c47c9efe0e (patch)
tree593930c9d84a062e86217f70f299df6170633c13 /test
parent05f5c01ba6b609f8b15574412fd874adda322590 (diff)
downloadclod-fe363eed4fd96c4443c4ca9ffe13c2c47c9efe0e.tar.gz
Support migrating lists, which Gitano needs at least short-term
Diffstat (limited to 'test')
-rw-r--r--test/test-clod.lua33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/test-clod.lua b/test/test-clod.lua
index 7fc05cd..855be41 100644
--- a/test/test-clod.lua
+++ b/test/test-clod.lua
@@ -315,6 +315,39 @@ foo["*"] "Gawd"
assert(conf:serialise() == output_str)
end
+function suite.migrate_tables_assign()
+ local input_str = [[
+tab = { "hello", "world" }
+]]
+ local conf = assert(clod.parse(input_str, "@str", true))
+ local tab = conf:get_list('tab')
+ assert(#tab == 2)
+ assert(tab[1] == "hello")
+ assert(tab[2] == "world")
+ local output_str = [[
+tab["*"] "hello"
+tab["*"] "world"
+]]
+ assert(conf:serialise() == output_str)
+end
+
+function suite.migrate_tables_call()
+ local input_str = [[
+tab { "hello", "world" }
+]]
+ local conf = assert(clod.parse(input_str, "@str", true))
+ local tab = conf:get_list('tab')
+ assert(#tab == 2)
+ assert(tab[1] == "hello")
+ assert(tab[2] == "world")
+ local output_str = [[
+tab["*"] "hello"
+tab["*"] "world"
+]]
+print(conf:serialise())
+ assert(conf:serialise() == output_str)
+end
+
local count_ok = 0
for _, testname in ipairs(testnames) do
-- print("Run: " .. testname)