Files
wnsrc/lua/tests/gm_express/pon.lua
lifestorm 9c918c46e5 Upload
2024-08-04 23:12:27 +03:00

49 lines
1.1 KiB
Lua

--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
return {
groupName = "pON",
beforeAll = function()
require( "pon" )
end,
beforeEach = function( state )
state.tbl = {
1, "a", true, false, nil, {}, { {}, {}, nil },
Color( 1, 1, 1 ), Angle( 1, 1, 1 ), Vector( 1, 1, 1 ), game.GetWorld()
}
end,
cases = {
{
name = "It loads properly",
func = function()
expect( pon ).to.exist()
end
},
{
name = "It encodes a table",
func = function( state )
expect( pon.encode, state.tbl ).to.succeed()
end
},
{
name = "It decodes a pON string",
func = function( state )
local encoded = pon.encode( state.tbl )
expect( pon.decode, encoded ).to.succeed()
end
}
}
}