test_vector_utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MapCache = make(map[string]ElementMap) // @Tabaie: global bad?

Functions

func AssertSliceEqual

func AssertSliceEqual[T comparable](t *testing.T, expected, seen []T)

func SliceEqual

func SliceEqual[T comparable](expected, seen []T) bool

func ToMap

func ToMap(keys1, keys2, values []frontend.Variable) map[string]interface{}

func ToVariable

func ToVariable(v interface{}) frontend.Variable

func ToVariableSlice

func ToVariableSlice[V any](slice []V) (variableSlice []frontend.Variable)

func ToVariableSliceSlice

func ToVariableSliceSlice[V any](sliceSlice [][]V) (variableSliceSlice [][]frontend.Variable)

Types

type DoubleMap

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

The keys in a DoubleMap must be constant. i.e. known at setup time

func (DoubleMap) Get

func (m DoubleMap) Get(api frontend.API, key1, key2 frontend.Variable) frontend.Variable

Get is very inefficient. Do not use outside testing

type ElementMap

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

func ElementMapFromFile

func ElementMapFromFile(path string) (ElementMap, error)

func ReadMap

func ReadMap(in map[string]interface{}) ElementMap

type Map

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

func (Map) Get

func (m Map) Get(api frontend.API, key frontend.Variable) frontend.Variable

Get returns garbage if key is not present

type MapHash

type MapHash struct {
	Map ElementMap

	API frontend.API
	// contains filtered or unexported fields
}

func (*MapHash) Reset

func (m *MapHash) Reset()

func (*MapHash) Sum

func (m *MapHash) Sum() frontend.Variable

func (*MapHash) Write

func (m *MapHash) Write(data ...frontend.Variable)

Jump to

Keyboard shortcuts

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