testutils

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: MIT Imports: 6 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) string

func RunExpressionTests

func RunExpressionTests(t *testing.T, d bob.Dialect, cases ExpressionTestcases)

func RunTests

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

Types

type ExpressionTestcase

type ExpressionTestcase struct {
	Expression    bob.Expression
	ExpectedSQL   string
	ExpectedArgs  []any
	ExpectedError error
	Doc           string
}

Also used to generate documentation

type ExpressionTestcases

type ExpressionTestcases map[string]ExpressionTestcase

type Testcase

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

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