Skip to content

Conversation

mikattack
Copy link
Contributor

As recommended, an internal/assert package was added with a reduced set of assertions. All tests were then refactored to use the internal assertions. When more complex assertions were used, they have been rewritten using logic and the simplified assertions.

Fancy formatting for failures was omitted. The internal/assert/assertions.diff function could be overwritten for better formatting. That is where diff libraries are used in other test suites.

Refs: #872

As recommended, an `internal/assert` package was added with a reduced set of assertions. All tests were then refactored to use the internal assertions. When more complex assertions were used, they have been rewritten using logic and the simplified assertions.

Fancy formatting for failures was omitted. The `internal/assert/assertions.diff` function could be overwritten for better formatting. That is where diff libraries are used in other test suites.

Refs: pelletier#872
@pelletier pelletier merged commit 014204c into pelletier:v2 Apr 7, 2025
11 checks passed
@pelletier
Copy link
Owner

Thank you for making this change!

@pelletier pelletier added testing Issue related to a testing problem or enhancement. and removed testing Issue related to a testing problem or enhancement. labels Apr 7, 2025
}
t.Helper()
msg := formatMsgAndArgs("Expected zero value but got:", msgAndArgs...)
t.Fatalf("%s\n%s", msg, fmt.Sprintf("%v", value))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not?

	t.Fatalf("%s\n%v", msg, value)

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.

3 participants