test

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal[T comparable](a, b []T) bool

equal returns true if the two given slices are equal, false otherwise

func Inequality

func Inequality[T comparable](actual, expected T) bool

Inequality is a helper function that returns true if the actual value is not equal to the expected value

Types

type TestCase

type TestCase[T any] struct {
	Desc     string                        // Description of the test case
	Actual   func() T                      // Function to generate the actual value
	Expected T                             // Expected value to compare the actual value with
	Fail     func(actual, expected T) bool // Function to compare the actual and expected values. If true, the test case has failed
}

TestCase is a struct that contains the information needed to describe a test case

Jump to

Keyboard shortcuts

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