newline & indent options

This commit is contained in:
kikito
2014-09-13 12:33:20 +02:00
parent 9054ee1051
commit 99e8c03959
3 changed files with 39 additions and 1 deletions

View File

@@ -197,6 +197,22 @@ describe( 'inspect', function()
end)
end)
describe('the newline option', function()
it('changes the substring used for newlines', function()
local t = {a={b=1}}
assert.equal(inspect(t, {newline='@'}), "{@ a = {@ b = 1@ }@}")
end)
end)
describe('the indent option', function()
it('changes the substring used for indenting', function()
local t = {a={b=1}}
assert.equal(inspect(t, {indent='>>>'}), "{\n>>>a = {\n>>>>>>b = 1\n>>>}\n}")
end)
end)
describe('the process option', function()
it('removes one element', function()