Skip to content

rna-transcription: avoid using assert!(something().is_err())#972

Merged
coriolinus merged 1 commit intomasterfrom
rna-transcription-avoid-is_err-in-tests
Oct 2, 2020
Merged

rna-transcription: avoid using assert!(something().is_err())#972
coriolinus merged 1 commit intomasterfrom
rna-transcription-avoid-is_err-in-tests

Conversation

@coriolinus
Copy link
Copy Markdown
Member

assert!(something().is_err()) is an antipattern in testing because
it hides the particular error, and most of the time that is undesired.
It's better to expect a particular error result. This demonstrates
better error-handling techniques for students.

`assert!(something().is_err())` is an antipattern in testing because
it hides the particular error, and most of the time that is undesired.
It's better to expect a particular error result. This demonstrates
better error-handling techniques for students.
@coriolinus coriolinus merged commit 4507478 into master Oct 2, 2020
@coriolinus coriolinus deleted the rna-transcription-avoid-is_err-in-tests branch October 2, 2020 06:36
elektronaut0815 pushed a commit to elektronaut0815/rust that referenced this pull request Oct 2, 2020
…m#972)

`assert!(something().is_err())` is an antipattern in testing because
it hides the particular error, and most of the time that is undesired.
It's better to expect a particular error result. This demonstrates
better error-handling techniques for students.
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.

2 participants