junit

package
v0.59.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2026 License: MIT Imports: 2 Imported by: 0

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

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

func AssertEqualsDeep(t *testing.T, expected, actual any)

AssertEqualsDeep checks that expected equals actual using reflect.DeepEqual. Use this for comparing struct values through pointers.

func AssertEqualsFloat64

func AssertEqualsFloat64(t *testing.T, expected, actual, tolerance float64)

AssertEqualsFloat64 checks that expected equals actual within the given tolerance.

func AssertEqualsNaN

func AssertEqualsNaN(t *testing.T, expected, actual float64)

AssertEqualsNaN checks that actual is NaN when expected is NaN. For JUnit assertEquals compatibility with NaN values.

func AssertFalse

func AssertFalse(t *testing.T, condition bool)

AssertFalse checks that the condition is false.

func AssertNotNull

func AssertNotNull(t *testing.T, value any)

AssertNotNull checks that the value is not nil. Uses reflection to properly handle typed nil pointers.

func AssertNull

func AssertNull(t *testing.T, value any)

AssertNull checks that the value is nil. Uses reflection to properly handle typed nil pointers.

func AssertTrue

func AssertTrue(t *testing.T, condition bool)

AssertTrue checks that the condition is true.

func Fail

func Fail(t *testing.T, message string)

Fail fails the test with the given message.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL