Skip to content

Conversation

alexandear
Copy link
Contributor

@alexandear alexandear commented Sep 26, 2023

Summary

This PR refactors suite tests.

Changes

  • reverse actual-expected parameters in asserts;
  • use assert.False(t, val) instead of assert.Equal(t, false, val);
  • use assert.Len(t, slice, v) instead of assert.Equal(t, len(slice), v);
  • remove duplicated assert.Equal(suite.T(),...).

Motivation

To simplify test code and provide precise output if a test fails.

Related issues

@dolmen dolmen added pkg-suite Change related to package testify/suite internal/refactor Refactor internals with no external visible changes internal/testing Changes purely related to the testify testsuites Changes Requested hacktoberfest-accepted Hacktoberfest labels Oct 10, 2023
@alexandear alexandear requested a review from dolmen October 10, 2023 13:27
@dolmen dolmen merged commit 351d277 into stretchr:master Oct 30, 2023
@dolmen
Copy link
Collaborator

dolmen commented Oct 30, 2023

Thanks @alexandear!

@alexandear alexandear deleted the suite-refactor-assertions branch October 31, 2023 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Hacktoberfest internal/refactor Refactor internals with no external visible changes internal/testing Changes purely related to the testify testsuites pkg-suite Change related to package testify/suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants