testhelp

package
v0.0.0-...-1dd1f65 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package testhelp contains test helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpectErrorIs

func ExpectErrorIs(t *testing.T, got, want error, context string) bool

ExpectErrorIs checks whether got has an 'Is' relation to want (or, if want is nil, whether got is non-nil). If not, it fails the test with a message mentioning context and returns false.

func TestFilesOfExt

func TestFilesOfExt(t *testing.T, dir, ext string, f func(t *testing.T, name, path string))

TestFilesOfExt is a scaffold for running a testing payload on every file in a directory dir that has extension ext. The tester function f receives the extensionless basename name and full path path. ext must contain a leading ".".

func TestJSONRoundTrip

func TestJSONRoundTrip(t *testing.T, want interface{}, context string)

TestJSONRoundTrip tests that encoding want to TOML then decoding it produces a value that is deep-equal to want.

func TestTomlRoundTrip

func TestTomlRoundTrip(t *testing.T, want interface{}, context string)

TestTomlRoundTrip tests that encoding want to TOML then decoding it produces a value that is deep-equal to want.

Types

This section is empty.

Jump to

Keyboard shortcuts

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