From fe363eed4fd96c4443c4ca9ffe13c2c47c9efe0e Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 25 Aug 2012 14:12:27 +0100 Subject: Support migrating lists, which Gitano needs at least short-term --- test/test-clod.lua | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'test') 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) -- cgit v1.2.1