mirror of
https://github.com/kikito/inspect.lua.git
synced 2024-12-15 14:34:21 +00:00
depth works on values. It was too easy
This commit is contained in:
parent
4e3eb102ed
commit
71bf1a87a0
@ -77,6 +77,32 @@ context( 'inspect', function()
|
||||
}]])
|
||||
end)
|
||||
|
||||
test('Should respect depth', function()
|
||||
local level4 = { 1,2,3, a = { b = { c = { d = 4 } } } }
|
||||
assert_equal(inspect(level4, 4), [[{ 1, 2, 3,
|
||||
a = {
|
||||
b = {
|
||||
c = {
|
||||
d = 4
|
||||
}
|
||||
}
|
||||
}
|
||||
}]])
|
||||
assert_equal(inspect(level4, 3), [[{ 1, 2, 3,
|
||||
a = {
|
||||
b = {
|
||||
c = {...}
|
||||
}
|
||||
}
|
||||
}]])
|
||||
assert_equal(inspect(level4, 2), [[{ 1, 2, 3,
|
||||
a = {
|
||||
b = {...}
|
||||
}
|
||||
}]])
|
||||
end)
|
||||
|
||||
end)
|
||||
|
||||
|
||||
end)
|
||||
|
Loading…
Reference in New Issue
Block a user