Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bodyEquals prints actual body. #1525

Merged
merged 1 commit into from Jun 14, 2018

Conversation

@StevenXL
Copy link
Member

commented Jun 14, 2018

Before submitting your PR, check that you've:

  • Bumped the version number

After submitting your PR:

  • Update the Changelog.md file with a link to your PR
  • Check that CI passes (or if it fails, for reasons unrelated to your change, like CI timeouts)

@StevenXL StevenXL force-pushed the StevenXL:bodyequals branch from d4dacf9 to a44cb54 Jun 14, 2018

@StevenXL

This comment has been minimized.

Copy link
Member Author

commented Jun 14, 2018

Hoping to address #1495.

(simpleBody res) == encodeUtf8 (TL.pack text)
bodyEquals text = withResponse $ \ res -> do
let actual = simpleBody res
msg = concat ["Expected body to equal ", text, ". Actual is: ", BSL8.unpack actual]

This comment has been minimized.

Copy link
@snoyberg

snoyberg Jun 14, 2018

Member

Would it make sense for display purposes to put text and actual on their own lines? Also, I think it would be better to use UTF8 decoding (maybe via decodeUtf8With lenientDecode) instead of Char8.

This comment has been minimized.

Copy link
@StevenXL

StevenXL Jun 14, 2018

Author Member

Changes made. Let me know what you think.

@StevenXL StevenXL force-pushed the StevenXL:bodyequals branch from a44cb54 to 0a089c8 Jun 14, 2018

@snoyberg
Copy link
Member

left a comment

LGTM, let's merge when Travis goes green

@snoyberg snoyberg merged commit 0437ace into yesodweb:master Jun 14, 2018

1 of 2 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.