Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Test.Amazonka.Util: Consistently use @=? in tests
This gives correct "expected"/"got" messages when tests fail.
  • Loading branch information
endgame committed Mar 10, 2025
commit e955a4bfb99beb620c7b1f9d4db7dd26d86fe958
12 changes: 6 additions & 6 deletions lib/amazonka-core/test/Test/Amazonka/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ testFromText ::
Text ->
a ->
TestTree
testFromText n t x = testCase n (Right x @?= fromText t)
testFromText n t x = testCase n (Right x @=? fromText t)

testToText ::
(ToText a, Show a, Eq a) =>
TestName ->
Text ->
a ->
TestTree
testToText n t x = testCase n (t @?= toText x)
testToText n t x = testCase n (t @=? toText x)

testToQuery ::
(ToQuery a, Show a, Eq a) =>
Expand All @@ -76,15 +76,15 @@ testFromXML ::
TestTree
testFromXML n bs x =
testCase n $
Right (X x) @?= (decodeXML (wrapXML bs) >>= parseXML)
(decodeXML (wrapXML bs) >>= parseXML) @=? Right (X x)

testToXML ::
(ToXML a, Show a, Eq a) =>
TestName ->
ByteStringLazy ->
a ->
TestTree
testToXML n bs x = testCase n $ wrapXML bs @?= encodeXML (X x)
testToXML n bs x = testCase n $ wrapXML bs @=? encodeXML (X x)

testFromJSON ::
(FromJSON a, Show a, Eq a) =>
Expand All @@ -94,15 +94,15 @@ testFromJSON ::
TestTree
testFromJSON n bs x =
testCase n $
Right (X x) @?= eitherDecode' ("{\"x\":" <> bs <> "}")
eitherDecode' ("{\"x\":" <> bs <> "}") @=? Right (X x)

testToJSON ::
(ToJSON a, Show a, Eq a) =>
TestName ->
ByteStringLazy ->
a ->
TestTree
testToJSON n bs x = testCase n (bs @?= Aeson.encode x)
testToJSON n bs x = testCase n (bs @=? Aeson.encode x)

str :: ByteStringLazy -> ByteStringLazy
str bs = "\"" <> bs <> "\""
Expand Down