testutil

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diff

func Diff(expected, actual string) string

Diff fn

func GoImport

func GoImport(t testing.TB, abspath string) func(s string) string

GoImport fn

func GoRun

func GoRun(t testing.TB, path, main string) (string, string, func())

GoRun write a main.go file runs it, returning the result

func Name

func Name(t Test) string

Name of the test

func Truncate

func Truncate(str string, num int) string

Truncate a string by n

Types

type Test

type Test struct {
	Schema string
	Name   string
	Before string
	After  string
	Func   string
	Expect string
	Error  string
}

Test struct

Jump to

Keyboard shortcuts

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