feat(std): add ordering assertions
@@ -40,6 +40,22 @@ let assert_neq l r : [Show a] -> [Eq a] -> a -> a -> Eff [| writer : Test | r |]
if l /= r then wrap ()
else tell (Cons ("Assertion failed: " <> show l <> " == " <> show r) Nil)
+let assert_lt l r : [Show a] -> [Ord a] -> a -> a -> Eff [| writer : Test | r |] () =
+ if l < r then wrap ()
+ else tell (Cons ("Assertion failed: " <> show l <> " >= " <> show r) Nil)
+
+let assert_lte l r : [Show a] -> [Ord a] -> a -> a -> Eff [| writer : Test | r |] () =
+ if l <= r then wrap ()
+ else tell (Cons ("Assertion failed: " <> show l <> " > " <> show r) Nil)
+
+let assert_gt l r : [Show a] -> [Ord a] -> a -> a -> Eff [| writer : Test | r |] () =
+ if l > r then wrap ()
+ else tell (Cons ("Assertion failed: " <> show l <> " <= " <> show r) Nil)
+
+let assert_gte l r : [Show a] -> [Ord a] -> a -> a -> Eff [| writer : Test | r |] () =
+ if l >= r then wrap ()
+ else tell (Cons ("Assertion failed: " <> show l <> " < " <> show r) Nil)
+
let assert_ok res : [Show e] -> Result e a -> Eff [| writer : Test | r |] () =
match res with
| Ok _ -> wrap ()
