Add tests for some uncovered functions.

This commit is contained in:
James Roseborough
2008-06-04 15:33:21 +00:00
parent dfdb876581
commit 3906bb9968

View File

@@ -77,3 +77,17 @@ print(string.len("\0\1\2\3"))
print(#"\0\1\2\3")
local s = "\194\161Hola!"
print(s, string.len(s), #s)
local function strtests(name,func,...)
print(name, 'good', pcall( func, ... ) )
print(name, 'empty', pcall( func ) )
print(name, 'table', pcall( func, {} ) )
print(name, 'nil', pcall( func, nil ) )
end
strtests('lower', string.lower, s )
strtests('upper', string.upper, s )
strtests('reverse', string.reverse, s )
strtests('char', string.char, 92, 60, 61, 93 )
strtests('dump', string.dump, function() print('hello, world') end )