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

Result of stringifying a big NSData is too long #259

Closed
inket opened this issue Mar 2, 2016 · 1 comment · Fixed by #263
Closed

Result of stringifying a big NSData is too long #259

inket opened this issue Mar 2, 2016 · 1 comment · Fixed by #263

Comments

@inket
Copy link
Contributor

inket commented Mar 2, 2016

Failure to match an NSData prints an error too long to finish printing.

Example code:

let bigData = NSData(contentsOfFile: "/path/to/big/file")
expect(nil).to(equal(bigData))

Example output:

Test Case '-[AppTests.ModelTests compares_two_data]' started.
/Users/inket/Documents/Development/App/AppTests/ModelTests.swift:146: error: -[AppTests.ModelTests compares_two_data] : failed - expected to equal <<89504e47 0d0a1a0a 0000000d 49484452 000010c0 00000b20 08020000 00670b70 e3000001 19694343 50494343 2050726f 66696c65 00002891 63606052 482c28c8 61126060 c8cd2b29 0a727752 88888c52 607fc0c0 ccc0c4c0 c3c0c5a0 97985c5c e01810e0 c3000430 1a157cbb c6c008a2 2feb82cc c294c70b b852528b 9381f41f 20ce4e2e 282a6160 60cc00b2 95cb4b0a 40ec1e20 5b24291b cc5e0062 17011d08 646f01b1 d321ec13 603510f6 1db09a90 206720fb 0390cd97 04663381 ece24b87 b005406c a8bd2020 e898929f 94aa00f2 bd86a1a5
...

I would assume stringify is the part responsible for this, but I'm unfamiliar with the project.

Suggested fix: Truncating the output.

@jeffh
Copy link
Member

jeffh commented Mar 9, 2016

Hey @inket,

Thanks for filing an issue. Actually Nimble doesn't do any truncation of any output. Getting NSData's description will output that.

That being said, I think it's perfectly reasonable to have Nimble truncate its data.

phatblat pushed a commit to phatblat/Nimble that referenced this issue May 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants