Some libraries outside of core use this library as their way of testing. The problem is that the output is pretty hard to understand. How would we feel about adding a few small helpers to make the output better?
assertEqual ∷ forall a eff. Eq a => Show a => { expected :: a, actual :: a } -> Eff (assert :: ASSERT | eff) Unit
assertEqual {actual, expected} = do
unless result $ log message
assert' message result
where
message = "Expected: " <> show expected <> "\nActual: " <> show actual
result = actual == expected
assertTrue :: forall eff. Boolean -> Eff (assert :: ASSERT | eff) Unit
assertTrue actual = assertEqual { actual, expected: true }
assertFalse :: forall eff. Boolean -> Eff (assert :: ASSERT | eff) Unit
assertFalse actual = assertEqual { actual, expected: false }
Some libraries outside of core use this library as their way of testing. The problem is that the output is pretty hard to understand. How would we feel about adding a few small helpers to make the output better?