Add assertNotEq

This commit is contained in:
Amitai Burstein 2017-04-11 20:30:55 +03:00
parent d8919c2c2d
commit b8d2647a6a
3 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,8 @@
## 1.5.6
* Add assertNotEq.
[#1375](https://github.com/yesodweb/yesod/pull/1375)
## 1.5.5
* Fix warnings

View File

@ -86,6 +86,7 @@ module Yesod.Test
-- * Assertions
, assertEqual
, assertNotEq
, assertEqualNoShow
, assertEq
@ -335,6 +336,17 @@ assertEq m a b =
"First argument: " ++ ppShow a ++ "\n" ++
"Second argument: " ++ ppShow b ++ "\n"
-- | Asserts that the two given values are not equal.
--
-- In case they are equal, error mesasge includes the values.
--
-- @since 1.5.6
assertNotEq :: (Eq a, Show a) => String -> a -> a -> YesodExample site ()
assertNotEq m a b =
liftIO $ HUnit.assertBool msg (a /= b)
where msg = "Assertion: " ++ m ++ "\n" ++
"Both arguments: " ++ ppShow a ++ "\n"
{-# DEPRECATED assertEqual "Use assertEq instead" #-}
assertEqual :: (Eq a) => String -> a -> a -> YesodExample site ()
assertEqual = assertEqualNoShow

View File

@ -1,5 +1,5 @@
name: yesod-test
version: 1.5.5
version: 1.5.6
license: MIT
license-file: LICENSE
author: Nubis <nubis@woobiz.com.ar>