harper icon indicating copy to clipboard operation
harper copied to clipboard

Tests in `harper-core/tests/run_tests.rs` are poor at communicating their expectations

Open 86xsk opened this issue 10 months ago • 0 comments

When they fail, the only thing they communicate is the entire list of lints they got, and that the number of lints doesn't match a magic number they expect.

For most of these tests, this is just an inconvenience. They're short and only expect a few lints, so it's not too difficult to look into them and figure out what they expect. However, there is one test that expects specifically 49 lints. If that fails, well... good luck.

Aside from the difficulty in debugging, this is also a weakness in the tests. Since they're only checking the number of lints, not the type, they can pass even if they get incorrect lints.

86xsk avatar Jan 29 '26 06:01 86xsk