Files
mercury/tests/hard_coded/test_cord.exp
Paul Bone f10dc85be7 Test the cord.condense/1 function.
tests/hard_coded/test_cord.m:
tests/hard_coded/test_cord.exp:
    As above.
2013-07-02 16:22:26 +10:00

34 lines
1.0 KiB
Plaintext

cords:
Z = empty_cord
A = nonempty_cord(unit_node('a'))
B = nonempty_cord(list_node('b', []))
AB = nonempty_cord(branch_node(unit_node('a'), list_node('b', [])))
BA = nonempty_cord(branch_node(list_node('b', []), unit_node('a')))
ABA1 = nonempty_cord(branch_node(unit_node('a'), branch_node(list_node('b', []), unit_node('a'))))
ABA2 = nonempty_cord(branch_node(branch_node(unit_node('a'), list_node('b', [])), unit_node('a')))
BAB1 = nonempty_cord(branch_node(list_node('b', []), branch_node(unit_node('a'), list_node('b', []))))
BAB2 = nonempty_cord(branch_node(branch_node(list_node('b', []), unit_node('a')), list_node('b', [])))
ABBA = nonempty_cord(branch_node(branch_node(unit_node('a'), list_node('b', [])), branch_node(list_node('b', []), unit_node('a'))))
BAAB = nonempty_cord(branch_node(branch_node(list_node('b', []), unit_node('a')), branch_node(unit_node('a'), list_node('b', []))))
construction: ok
concatenation: ok
equals: ok
identity: ok
length: ok
membership: ok
map: ok
foldl: ok
foldr: ok
condense: ok