testutil

package
v0.0.67 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0, NCSA Imports: 13 Imported by: 0

Documentation

Overview

Package testutil provides support functions for unit testing implementations of the kcd.ReadWriter interface.

Index

Constants

View Source
const (
	Revision  = "1234"
	Corpus    = "ratzafratza"
	FormatKey = "λ"
	Language  = "go"
)

These constants are the expected values used by the Run tests.

Variables

UnitType is the type of compilation message stored in the database by the tests in Run.

Functions

func Run

func Run(t *testing.T, ctx context.Context, db kcd.ReadWriter) []error

Run applies a sequence of correctness tests to db, which must be initially empty, and returns any errors that occur. If db passes all the tests, the return value is nil; otherwise each error is of concrete type *TestError.

Types

type TestError

type TestError struct {
	Desc   string // Description of the test that failed (human-readable)
	Method string // The name of the method that returned an error
	Err    error  // The underlying error returned by the method
}

TestError is the concrete type of errors returned by the Run function.

func (*TestError) Error

func (t *TestError) Error() string

Jump to

Keyboard shortcuts

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