[View] [Edit] [Lock] [References] [Attachments] [History] [Home] [Changes] [Search] [Help]
test[m8n] 70 Expressions
--Simple expressions
test="3+4"
if (test:evaluate()~=7) then error("Must return 7") end
if (("Point"):evaluate()~=smalltalk.Point) then error("Must return Point") end
if (not ("Point selectors"):evaluate():eq_(smalltalk.Point:selectors())) then error("Must be equal") end
--Array literals
if (("#(1 2 3) asLiteral"):evaluate()~="#( 1 2 3 )") then error("Wrong result") end
if (("#(1 2 3)"):evaluate():_eq(smalltalk.Array:with_with_with_(1,2,3))~=true) then error("Must return #(1 2 3)") end
--counting
print(("MethodReferences new allMethods size"):showIt())
print(("Exporter allClasses size"):showIt())
--system recompilation
print("System recompilation (in lua) took ",("[Object recompileAll]ms"):evaluate(),"ms")
--cleanup
test=nil