nested dictionary tables start working

This commit is contained in:
Enrique García Cota
2011-04-24 00:04:45 +02:00
parent 51153a31c6
commit b51be52bf0
2 changed files with 44 additions and 16 deletions

View File

@@ -46,6 +46,7 @@ context( 'inspect', function()
context('tables', function()
test('Should work with simple array-like tables', function()
assert_equal(inspect({1,2,3}), "{1, 2, 3}" )
end)
@@ -54,10 +55,21 @@ context( 'inspect', function()
assert_equal(inspect({'a','b','c', {'d','e'}, 'f'}), '{"a", "b", "c", {"d", "e"}, "f"}' )
end)
test('Should work with simple hash-like tables', function()
test('Should work with simple dictionary tables', function()
assert_equal(inspect({a = 1, b = 2}), "{\n a = 1,\n b = 2\n}")
end)
test('Should work with nested dictionary tables', function()
nestedDict = [[{
a = 1,
b = {
c = 2
},
d = 3
}]]
assert_equal(inspect( {a=1, b={c=2}, d=3} ), nestedDict)
end)
end)
end)