lama_byterun/stdlib/regression/test01.expr

34 lines
657 B
Text
Raw Normal View History

import Collection;
local s = emptySet (), i;
for i := 0, i < 100, i := i+1
do
s := addSet (s, i);
validateColl (s)
od;
printf ("Set internal structure: %s\n", s.string);
printf ("Set elements: %s\n", elements (s).string);
for i := 0, i < 100, i := i+1
do
printf ("Testing %-3d => %d\n", i, memSet (s, i));
printf ("Testing %-3d => %d\n", i+100, memSet (s, i+100))
od;
for i := 50, i < 150, i := i+1
do
s := removeSet (s, i);
validateColl (s)
od;
printf ("Set internal structure: %s\n", s.string);
printf ("Set elements: %s\n", elements (s).string);
for i := 0, i < 100, i := i+1
do
printf ("Testing %-3d => %d\n", i, memSet (s, i))
od