Skip to content

wiki: TestComments change - assert libraries #50573

@rthier

Description

@rthier

The section about Assert Libraries discourage the use of them.

But I guess there's a little bit mistake in this approach because we have good libraries that provide assert functions.

The argument omits interesting information about what the test got right is not the real true, is more easy to understand what the test does with 2 or 3 asserts than a if with 2 or 3 ORs inline. Furthermore libraries as Testify provide rich and easy-readable informations when the test fails in the assert functions.

Finally, using asserts or ifs don't guarantee that the test is right, the argument Assert libraries make it too easy to write imprecise tests is more about the quality of test than the use of an assert library.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions