diff --git a/src/Test/Hspec/Expectations/Matcher.hs b/src/Test/Hspec/Expectations/Matcher.hs index e39e030..2926d09 100644 --- a/src/Test/Hspec/Expectations/Matcher.hs +++ b/src/Test/Hspec/Expectations/Matcher.hs @@ -17,10 +17,10 @@ xs `matchList` ys err :: ShowS err = showString "Actual list is not a permutation of expected list!\n" - . msgAndList " expected list contains: " ys - . msgAndList " actual list contains: " xs - . optMsgList " the missing elements are: " missing - . optMsgList " the extra elements are: " extra + . msgAndList " expected elements: " ys + . msgAndList " actual elements: " xs + . optMsgList " missing elements: " missing + . optMsgList " extra elements: " extra showList :: Show a => [a] -> ShowS showList xs = showChar '[' . foldr (.) (showChar ']') (intersperse (showString ", ") $ map shows xs) diff --git a/test/Test/Hspec/Expectations/MatcherSpec.hs b/test/Test/Hspec/Expectations/MatcherSpec.hs index 5b4d49a..9be6bbd 100644 --- a/test/Test/Hspec/Expectations/MatcherSpec.hs +++ b/test/Test/Hspec/Expectations/MatcherSpec.hs @@ -20,15 +20,15 @@ spec = do it "shows extra elements" $ do [1, 2, 2, 3] `matchList` [1, 2, 3 :: Int] `shouldBe` (Just . unlines) [ "Actual list is not a permutation of expected list!" - , " expected list contains: [1, 2, 3]" - , " actual list contains: [1, 2, 2, 3]" - , " the extra elements are: [2]" + , " expected elements: [1, 2, 3]" + , " actual elements: [1, 2, 2, 3]" + , " extra elements: [2]" ] it "shows missing elements" $ do [1, 2, 3] `matchList` [1, 2, 2, 3 :: Int] `shouldBe` (Just . unlines) [ "Actual list is not a permutation of expected list!" - , " expected list contains: [1, 2, 2, 3]" - , " actual list contains: [1, 2, 3]" - , " the missing elements are: [2]" + , " expected elements: [1, 2, 2, 3]" + , " actual elements: [1, 2, 3]" + , " missing elements: [2]" ]