%%% $Id: TestingTest.oz,v 1.1 2007/10/14 17:56:08 leavens Exp leavens $ declare [Testing] = {Module.link ['Testing.ozf']} {Testing.start 'Test'} X = 3 {Testing.test X '==>' 3} {Testing.test X '==' 3} {Testing.test X '=' 3} local B EX in try {Testing.test X '==>' 4} B = false catch EXC then B = true EX=EXC end if B then {System.showInfo 'correctly caught ' # {Value.toVirtualString EX 5 10}} {System.showInfo 'ok'} else {System.showInfo 'failed'} raise testDidntWork end end end local Foo = fun {$ Y} Y + 4 end in {Testing.test {Foo X} '=' 7} end {Testing.start 'Assert'} Z = 3 {Testing.assert Z == 3} local B EX in try {Testing.assert Z == 4} B = false catch EXC then B = true EX = EXC end if B then {System.showInfo 'correctly caught ' # {Value.toVirtualString EX 5 10}} else {System.showInfo 'failed'} raise assertDidntWork end end end local Foo = fun {$ Y} Y + 3 end in {Testing.assert {Foo Z} == 6} end {System.showInfo 'ok'}