\r
import StdEnv\r
\r
+Contains :: a [a] -> Bool | == a\r
+Contains x xs = foldl (\b y . b || x == y) False xs\r
+\r
EqualTo :: a a -> Bool | == a\r
EqualTo x y = x == y\r
\r
a1 = AssertThat "(2*2) (Is (EqualTo (2+2)))" (2*2) (Is(EqualTo (2+2)))\r
a2 = AssertThat "(3*3) (EqualTo (3+3))" (3*3) (EqualTo (3+3))\r
a3 = AssertThat "(length [0..3]) is not 4" (length [0..3]) (Not(EqualTo 4))\r
+a4 = AssertThat "[0..3] (Contains 2)" [0..3] (Contains 2)\r
+a5 = AssertThat "[0..3] (Contains 7)" [0..3] (Contains 7)\r
+a6 = AssertThat "[0..3] (Either (EqualTo [1]) (Contains 7))" [0..3] (EqualTo [1] Or (Contains 7))\r
\r
-report = test (a1*a2*a3)\r
+report = test (a1*a2*a3*a4*a5*a6)\r
\r
instance <<< [String] where\r
(<<<) file [] = file\r