testutil

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArgsDiff

func ArgsDiff(a, b []any) string

func Clean

func Clean(s string) string

func ErrDiff

func ErrDiff(a, b error) string

func QueryDiff

func QueryDiff(a, b string, clean FormatFunc) (string, error)

func RunTests

func RunTests(t *testing.T, cases Testcases, format FormatFunc)

Types

type FormatFunc

type FormatFunc = func(string) (string, error)

type Testcase

type Testcase struct {
	ExpectedSQL  string
	Doc          string
	Query        string
	ExpectedArgs []any
}

Also used to generate documentation

type Testcases

type Testcases map[string]Testcase

Jump to

Keyboard shortcuts

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