testutil

package
v0.0.0-...-bf7cbd6 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const SafeString = "start\t\n \rend<p>name</p>alert('name');"
View Source
const UnsafeString = "\t\n \rstart\t\n \rend<p>name</p>alert('name');\t\n \r"

Variables

This section is empty.

Functions

func CompareError

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

func RunValidationTests

func RunValidationTests(t *testing.T, v Validator, msg string, fieldErrors map[string]string)

Types

type Database

type Database struct {
	// contains filtered or unexported fields
}

func TestDatabase

func TestDatabase(ctx context.Context, t *testing.T) *Database

func (*Database) Exec

func (db *Database) Exec(ctx context.Context, query string, args ...interface{}) error

func (*Database) QueryRow

func (db *Database) QueryRow(ctx context.Context, query string, args ...interface{}) pg.Row

type TestLogger

type TestLogger struct {
	*logger.JSONLogger
	// contains filtered or unexported fields
}

func NewTestLogger

func NewTestLogger() *TestLogger

func (*TestLogger) ShouldLog

func (tl *TestLogger) ShouldLog(t *testing.T, want ...string)

type Validator

type Validator interface{ Validate() error }

Jump to

Keyboard shortcuts

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