Help us shape the future of Go! Take the 2026 Go Developer Survey

testutil

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BigintValue added in v0.17.0

func BigintValue(v int64) expr.LiteralValue

BigintValue creates a literal value of type Bigint.

func BoolValue

func BoolValue(v bool) expr.LiteralValue

BoolValue creates a literal value of type Bool.

func ByteaValue added in v0.18.0

func ByteaValue(v []byte) expr.LiteralValue

ByteaValue creates a literal value of type bytea.

func DoubleValue

func DoubleValue(v float64) expr.LiteralValue

DoubleValue creates a literal value of type Double.

func Dump

func Dump(t testing.TB, v any)

Dump a json representation of v to os.Stdout.

func DumpPebble

func DumpPebble(t testing.TB, pdb *pebble.DB)

func Exec

func Exec(db *database.Database, tx *database.Transaction, q string, params ...environment.Param) error

func ExprList

func ExprList(t testing.TB, s string) expr.LiteralExprList

func ExprRunner

func ExprRunner(t *testing.T, testfile string)

func FunctionExpr

func FunctionExpr(t testing.TB, name string, args ...expr.Expr) expr.Expr

func Int64Ptr

func Int64Ptr(n int64) *int64

func IntegerValue

func IntegerValue(v int32) expr.LiteralValue

IntegerValue creates a literal value of type Integer.

func MakeRow added in v0.17.0

func MakeRow(t testing.TB, s string) row.Row

func MakeRowExpr added in v0.17.0

func MakeRowExpr(t testing.TB, s string) expr.Row

func MakeRowExprs added in v0.17.0

func MakeRowExprs(t testing.TB, s ...string) []expr.Row

func MakeRows added in v0.17.0

func MakeRows(t testing.TB, s ...string) []row.Row

func MustExec

func MustExec(t *testing.T, db *database.Database, tx *database.Transaction, q string, params ...environment.Param)

func MustQuery

func MustQuery(t *testing.T, db *database.Database, tx *database.Transaction, q string, params ...environment.Param) *statement.Result

func NewEngine

func NewEngine(t testing.TB) *kv.PebbleEngine

func NewKey

func NewKey(t testing.TB, values ...types.Value) *tree.Key

func NewTestConn added in v0.17.0

func NewTestConn(t testing.TB, db *database.Database) *database.Connection

func NewTestDB

func NewTestDB(t testing.TB) *database.Database

func NewTestTree

func NewTestTree(t testing.TB, namespace tree.Namespace) *tree.Tree

func NewTestTx

func NewTestTx(t testing.TB) (*database.Database, *database.Transaction, func())

func NullValue

func NullValue() expr.LiteralValue

NullValue creates a literal value of type Null.

func ParseExpr

func ParseExpr(t testing.TB, s string) expr.Expr

func ParseExprList added in v0.17.0

func ParseExprList(t testing.TB, s string) expr.LiteralExprList

func ParseExprs

func ParseExprs(t testing.TB, s ...string) []expr.Expr

func ParseNamedExpr

func ParseNamedExpr(t testing.TB, s string, name ...string) expr.Expr

func Query

func RequireJSONArrayEq added in v0.17.0

func RequireJSONArrayEq(t testing.TB, rows *sql.Rows, expected string)

func RequireJSONEq

func RequireJSONEq(t testing.TB, rows *sql.Rows, expected ...string)

func RequireRowEqual added in v0.17.0

func RequireRowEqual(t testing.TB, want, got row.Row)

func RequireRowsEq added in v0.17.0

func RequireRowsEq(t *testing.T, raw string, rows *sql.Rows)

func RequireRowsEqf added in v0.17.0

func RequireRowsEqf(t *testing.T, raw string, rows *sql.Rows, msg string, args ...any)

func RequireValueEqual

func RequireValueEqual(t testing.TB, want, got types.Value, msg string, args ...any)

func SQLRowToColumnBuffer added in v0.17.0

func SQLRowToColumnBuffer(t testing.TB, rows *sql.Rows) *row.ColumnBuffer

func TestExpr

func TestExpr(t testing.TB, exprStr string, env *environment.Environment, want types.Value, fails bool)

func TextValue

func TextValue(v string) expr.LiteralValue

TextValue creates a literal value of type Text.

Types

type ResultStream

type ResultStream struct {
	*parser.Parser
	// contains filtered or unexported fields
}

func ParseResultStream

func ParseResultStream(stream string) *ResultStream

func (*ResultStream) Next

func (ds *ResultStream) Next() (row.Row, error)

func (*ResultStream) ParseObject added in v0.17.0

func (p *ResultStream) ParseObject() (row.Row, error)

type Rows added in v0.17.0

type Rows []row.Row

func (Rows) RequireEqual added in v0.17.0

func (r Rows) RequireEqual(t testing.TB, others Rows)

func (Rows) RequireEqualStream added in v0.17.0

func (r Rows) RequireEqualStream(t testing.TB, env *environment.Environment, st *stream.Stream)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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