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

Use assert_eq! instead of assert! in tests #26071

Merged
merged 1 commit into from
Jun 14, 2015
Merged

Conversation

petrochenkov
Copy link
Contributor

assert_eq! has better diagnostics than assert! and is more helpful when something actually breaks, but the diagnostics has it's price - assert_eq! generate some formatting code which is slower to compile and possibly run.
My measurements show that presence of this formatting code doesn't affect compilation + execution time of the test suite significantly, so assert_eq! can be used instead of assert! consistently.

(Some tests doesn't reside in src/test, they are not affected by these changes, I'll probably open a separate PR for them later)

@rust-highfive
Copy link
Collaborator

r? @huonw

(rust_highfive has picked a reviewer for you, use r? to override)

@bors
Copy link
Contributor

bors commented Jun 13, 2015

☔ The latest upstream changes (presumably #26253) made this pull request unmergeable. Please resolve the merge conflicts.

@petrochenkov
Copy link
Contributor Author

Rebased.

@alexcrichton
Copy link
Member

@bors: r+ bddb685 p=1

bors added a commit that referenced this pull request Jun 14, 2015
`assert_eq!` has better diagnostics than `assert!` and is more helpful when something actually breaks, but the diagnostics has it's price - `assert_eq!` generate some formatting code which is slower to compile and possibly run.
[My measurements](https://internals.rust-lang.org/t/assert-a-b-or-assert-eq-a-b/1367/12?u=petrochenkov) show that presence of this formatting code doesn't affect compilation + execution time of the test suite significantly, so `assert_eq!` can be used instead of `assert!` consistently.

(Some tests doesn't reside in src/test, they are not affected by these changes, I'll probably open a separate PR for them later)
@bors
Copy link
Contributor

bors commented Jun 14, 2015

⌛ Testing commit bddb685 with merge e89bb24...

@bors bors merged commit bddb685 into rust-lang:master Jun 14, 2015
@petrochenkov petrochenkov deleted the assert1 branch September 21, 2015 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants