never executed always true always false
1 module TestCore.CustomAssertions (shouldContain') where 2 3 import Data.List (isInfixOf) 4 import Test.Hspec (Expectation, expectationFailure) 5 6 shouldContain' :: String -> String -> Expectation 7 shouldContain' haystack needle = 8 if needle `isInfixOf` haystack 9 then pure () 10 else 11 expectationFailure 12 ( ("expected to contain: " ++ needle) 13 ++ ("\n but got: " ++ haystack) 14 )