testutility

package
v1.6.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcceptanceTests added in v1.4.3

func AcceptanceTests(t *testing.T, reason string)

AcceptanceTests marks this test function as a extended that require additional dependencies automatically skipped unless running in a CI environment

func AssertMatchFixtureJSON

func AssertMatchFixtureJSON[V any](t *testing.T, path string, val V)

AssertMatchFixtureJSON matches the JSON at path with the value val, failing if not equal, printing out the difference.

func AssertMatchFixtureText added in v1.4.1

func AssertMatchFixtureText(t *testing.T, path string, actual string)

AssertMatchFixtureText matches the Text file at path with actual

func CreateJSONFixture deprecated

func CreateJSONFixture[V any](t *testing.T, path string, val V)

Deprecated: Not actually deprecated, deprecated tag used to warn users from checking in as it's meant to be used as a helper func to generate fixtures

CreateJSONFixture creates a JSON file at path of the value val, can be used with AssertMatchFixtureJSON to compare against future values.

func CreateTextFixture added in v1.4.1

func CreateTextFixture(t *testing.T, path string, val string)

CreateTextFixture creates a text file at path of the value val, can be used with AssertMatchFixtureJSON to compare against future values.

func LoadJSONFixture

func LoadJSONFixture[V any](t *testing.T, path string) V

LoadJSONFixture loads a JSON fixture file and returns the decoded version.

func ValueIfOnWindows added in v1.5.0

func ValueIfOnWindows(win, or string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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