@ -134,9 +134,14 @@ end
-- GLOBAL
Stack = {
__class__ = 'Stack'
__class__ = 'Stack',
}
Stack_MT = {
__index = Stack,
__tostring = function(t)
return table.tostring(Stack.list(t))
end
Stack_MT = { __index = Stack }
-- Create a Table with stack functions
function Stack:new()
@ -88,6 +88,14 @@ TestStack = {}
assertItemsEquals(l[1],{1,2,3})
assertEquals(l[2],1)
function TestStack:test_tostring()
s = Stack:new()
s:push(1)
assertEquals(tostring(s), "{1}")
s:push(2)
assertEquals(tostring(s), "{2,1}")
-- class TestStack
---- Control test output:
lu = LuaUnit