[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

obsolete[m8n] 71 literals

-- setup
test=smalltalk.Test:new()
empty=test:emptyArrayLiteral()
array=test:arrayLiteral()


--encoding arrays
if (array:class()["$className"]~="Array") then error("Must be an Array") end

if (not empty:isEmpty()) then error("Must be empty") end
if (empty:size()~=0) then error("Must be empty") end

if (array:size()~=3) then error("Must contain 3 elements") end
if (test:complexArrayLiteral():size()~=7) then error("Must contain 7 elements") end

local array=test:emptyArrayLiteral();array:add_(1);if (array:size()~=1) then error("Must contain one object") end

if (not smalltalk.Array:selectors():includes_("size")) then error("Missing implementation of Array>>#size") end



-- cleanup
test = nil
empty= nil
array= nil