test

package
v0.0.0-...-efc180c Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package test provides useful extensions to goconvey.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cache

func Cache(data *CacheData) evego.Cache

Cache returns a cache object used for testing.

func ShouldHaveComposition

func ShouldHaveComposition(actual interface{}, expected ...interface{}) string

ShouldHaveComposition compares a []component expected result against the actual []InventoryLine.

func SpatialiteModulePath

func SpatialiteModulePath() string

SpatialiteModulePath finds the path of the installed Spatialite module, for passing to the SQLite driver.

Types

type CacheData

type CacheData struct {
	GetKeys, PutKeys map[string]bool
	NumGets, NumPuts int
	PutExpires       time.Time
	// When ShouldError is set to true, a call to Put will error out.
	ShouldError bool
}

CacheData maintains information on calls by the test code to the cache.

type Component

type Component struct {
	Name     string
	Quantity int
}

Component is an output of reprocessing. When reprocessed, an item returns one or more MaterialOutputs. We could use InventoryLine here, but the tests are much easier to write this way.

func (Component) String

func (c Component) String() string

Jump to

Keyboard shortcuts

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