% $Id: StoreTest.oz,v 1.4 2012/01/03 15:20:19 leavens Exp $ \insert 'Store.oz' \insert 'TestingNoStop.oz' %% from the course library {StartTesting 'StoreTest $Revision: 1.4 $'} {Test {HasStore {EmptyStore} x} '==' false} local Loc#S2 = {AllocStore {EmptyStore}} in {Test {NameOfStore S2} '==' s2} {Test {HasStore S2 Loc} '==' true} {Test {Undetermined S2 Loc} '==' true} {Test {Determined S2 Loc} '==' false} local S3 = {UnifyLocVal S2 Loc num(3)} in {Test {HasStore S3 Loc} '==' true} {Test {Undetermined S3 Loc} '==' false} {Test {Determined S3 Loc} '==' true} {Test {Read S3 Loc} '==' num(3)} {Test {Read S3 Loc} '==' num(3)} local Loc4#S4 = {AllocStore S3} in {Test {NameOfStore S4} '==' s4} local Loc5#S5 = {AllocStore S4} in local S6 = {UnifyLocs S5 Loc4 Loc5} in {Test {Undetermined S6 Loc4} '==' true} {Test {Determined S6 Loc5} '==' false} local S7 = {UnifyLocVal S6 Loc5 num(272)} in {Test {Undetermined S7 Loc5} '==' false} {Test {Determined S7 Loc4} '==' true} {Test {Read S7 Loc} '==' num(3)} {Test {Read S7 Loc4} '==' num(272)} {Test {Read S7 Loc5} '==' num(272)} local S8 = {UnifyLocs S7 Loc5 Loc4} in {Test {Read S7 Loc4} '==' num(272)} {Test {Read S7 Loc5} '==' num(272)} {Test {EqualStore S7 S7} '==' true} {Test {EqualStore S6 S7} '==' false} {Test {EqualStore S7 S6} '==' false} {Test {EqualStore S6 S6} '==' true} end end end end end end end {Test {EqualStore {EmptyStore} {EmptyStore}} '==' true} local L0#S1 = {AllocStore {EmptyStore}} in {Test {EqualStore S1 S1} '==' true} end {DoneTesting}