testutil

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dump added in v0.11.0

func Dump(t testing.TB, v interface{})

Dump a json representation of v to os.Stdout.

func MakeArray added in v0.12.0

func MakeArray(t testing.TB, jsonArray string) document.Array

MakeArray creates an array from a json string.

func MakeArrayValue added in v0.12.0

func MakeArrayValue(t testing.TB, vs ...interface{}) document.Value

func MakeDocument

func MakeDocument(t testing.TB, jsonDoc string) document.Document

MakeDocument creates a document from a json string.

func MakeValue

func MakeValue(t testing.TB, v interface{}) document.Value

MakeValue turns v into a document.Value.

func MakeValueBuffer added in v0.12.0

func MakeValueBuffer(t testing.TB, jsonArray string) *document.ValueBuffer

func RequireDocJSONEq added in v0.12.0

func RequireDocJSONEq(t testing.TB, d document.Document, expected string)

Types

type Docs

type Docs []document.Document

func MakeDocuments

func MakeDocuments(t testing.TB, jsonDocs ...string) (docs Docs)

MakeDocuments creates a slice of document from json strings.

func (Docs) RequireEqual

func (docs Docs) RequireEqual(t testing.TB, others Docs)

type KV added in v0.11.0

type KV struct {
	Key, Value []byte
}

KV is used to represent key-value pairs stored in tables or indexes.

func GetIndexContent added in v0.11.0

func GetIndexContent(t testing.TB, tx *database.Transaction, indexName string) []KV

GetIndexContent iterates over the entire index and returns all the key-value pairs in order.

Jump to

Keyboard shortcuts

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