% $Id: SortedTest.oz,v 1.1 2007/11/26 21:06:49 leavens Exp leavens $ \insert 'Sorted.oz' \insert 'SolveFirst.oz' \insert 'TestingNoStop.oz' {StartTesting 'InsertBefore'} {Test {InsertBefore [3 1] 1 2} '==' [2 3 1]} {Test {InsertBefore [3 1] 2 2} '==' [3 2 1]} {Test {InsertBefore [3 1] 3 2} '==' [3 1 2]} {StartTesting 'Permutation'} {Test {SolveFirst proc {$ Out} {Permutation nil Out} end} '==' nil} {Test {List.take {Solve proc {$ Out} {Permutation [3 1 2] Out} end} 6} '==' [[3 1 2] [1 3 2] [1 2 3] [3 2 1] [2 3 1] [2 1 3]]} % existential query {StartTesting 'Sorted'} {Test {SolveFirst proc {$ Out} {Sorted nil Out} end} '==' nil} {Test {SolveFirst proc {$ Out} {Sorted [3 1 2] Out} end} '==' [1 2 3]} {Test {SolveFirst proc {$ Out} {Sorted [7 3 1 2 1] Out} end} '==' [1 1 2 3 7]}