Skip to content

dev: refactor some test assertions #4081

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

Merged
merged 1 commit into from
Sep 18, 2023

Conversation

alexandear
Copy link
Member

The PR refactors test assertions with the help of https://github.com/Antonboom/testifylint:

  • replace sort.Strings+assert.Equal with assert.ElementsMatch;
  • use require.NoError instead of assert.NoError to avoid possible panic;
  • replace assert.Len with require.Len where needed;
  • switch actual and expected parameters in assert statements.

@ldez ldez changed the title dev: refactor and fix test assertions dev: refactor some test assertions Sep 12, 2023
@ldez ldez self-requested a review September 12, 2023 10:14
@ldez ldez added the topic: cleanup Related to code, process, or doc cleanup label Sep 12, 2023
@Antonboom
Copy link
Contributor

Antonboom commented Sep 14, 2023

Appreciated :)

This make my PR "lighter"

@ldez ldez merged commit 0704271 into golangci:master Sep 18, 2023
@alexandear alexandear deleted the dev-refactor-test-assertions branch September 18, 2023 20:33
@ldez ldez modified the milestone: v1.55 Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: cleanup Related to code, process, or doc cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants