[View] [Edit] [Lock] [References] [Attachments] [History] [Home] [Changes] [Search] [Help]
test[m8n] 61 asLiteral
--basic #asLiteral implementation
if (("asLiteral"):implementors():size()~=3) then error("Must be 3") end
if (("(3@4) asLiteral"):evaluate()~="3 @ 4") then error("Wrong result") end
--String implementation
if (("hello"):asLiteral()~="#hello") then error("Must return #hello") end
if (("hello world"):asLiteral()~="hello world") then error("Must return 'hello world'") end
--Array implementation
if (("#(1 2 three #hello #(1 2))"):evaluate():asLiteral()~="#( 1 2 three hello #( 1 2 ) )") then error("Wrong result") end