Documentation
¶
Overview ¶
Package junit provides JUnit-style assertion helpers for ported tests. These helpers enable 1-1 line mapping between Java JUnit tests and Go tests.
Index ¶
- func AssertEquals[T comparable](t *testing.T, expected, actual T)
- func AssertEqualsDeep(t *testing.T, expected, actual any)
- func AssertEqualsFloat64(t *testing.T, expected, actual, tolerance float64)
- func AssertEqualsNaN(t *testing.T, expected, actual float64)
- func AssertFalse(t *testing.T, condition bool)
- func AssertNotNull(t *testing.T, value any)
- func AssertNull(t *testing.T, value any)
- func AssertTrue(t *testing.T, condition bool)
- func Fail(t *testing.T, message string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertEquals ¶
func AssertEquals[T comparable](t *testing.T, expected, actual T)
AssertEquals checks that expected equals actual.
func AssertEqualsDeep ¶
AssertEqualsDeep checks that expected equals actual using reflect.DeepEqual. Use this for comparing struct values through pointers.
func AssertEqualsFloat64 ¶
AssertEqualsFloat64 checks that expected equals actual within the given tolerance.
func AssertEqualsNaN ¶
AssertEqualsNaN checks that actual is NaN when expected is NaN. For JUnit assertEquals compatibility with NaN values.
func AssertFalse ¶
AssertFalse checks that the condition is false.
func AssertNotNull ¶
AssertNotNull checks that the value is not nil. Uses reflection to properly handle typed nil pointers.
func AssertNull ¶
AssertNull checks that the value is nil. Uses reflection to properly handle typed nil pointers.
func AssertTrue ¶
AssertTrue checks that the condition is true.
Types ¶
This section is empty.