Documentation
¶
Index ¶
- func ArrayElements(context interpreter.ContainerReadContext, array *interpreter.ArrayValue) []interpreter.Value
- func AssertValueSlicesEqual(t testing.TB, context interpreter.ValueComparisonContext, ...) bool
- func AssertValuesEqual(t testing.TB, context interpreter.ValueComparisonContext, ...) bool
- func DictionaryKeyValues(context interpreter.ContainerMutationContext, ...) []interpreter.Value
- func NewTestInterpreter(tb testing.TB) *interpreter.Interpreter
- func NewTestInterpreterWithStorage(tb testing.TB, storage interpreter.Storage) *interpreter.Interpreter
- func NewTestInterpreterWithStorageAndAtreeValidationConfig(tb testing.TB, storage interpreter.Storage, atreeValueValidationEnabled bool, ...) *interpreter.Interpreter
- func NewTestValueCreationContext(invokable common_utils.Invokable) *testValueCreationContext
- func NewUnmeteredInMemoryStorage() interpreter.InMemoryStorage
- func RequireValuesEqual(t testing.TB, context interpreter.ValueComparisonContext, ...)
- func ValuesAreEqual(context interpreter.ValueComparisonContext, expected, actual interpreter.Value) bool
- type DictionaryEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrayElements ¶
func ArrayElements(context interpreter.ContainerReadContext, array *interpreter.ArrayValue) []interpreter.Value
func AssertValueSlicesEqual ¶
func AssertValueSlicesEqual(t testing.TB, context interpreter.ValueComparisonContext, expected, actual []interpreter.Value) bool
func AssertValuesEqual ¶
func AssertValuesEqual(t testing.TB, context interpreter.ValueComparisonContext, expected, actual interpreter.Value) bool
func DictionaryKeyValues ¶
func DictionaryKeyValues(context interpreter.ContainerMutationContext, dict *interpreter.DictionaryValue) []interpreter.Value
func NewTestInterpreter ¶
func NewTestInterpreter(tb testing.TB) *interpreter.Interpreter
func NewTestInterpreterWithStorage ¶ added in v1.3.0
func NewTestInterpreterWithStorage(tb testing.TB, storage interpreter.Storage) *interpreter.Interpreter
func NewTestInterpreterWithStorageAndAtreeValidationConfig ¶ added in v1.3.0
func NewTestInterpreterWithStorageAndAtreeValidationConfig( tb testing.TB, storage interpreter.Storage, atreeValueValidationEnabled bool, atreeStorageValidationEnabled bool, ) *interpreter.Interpreter
func NewTestValueCreationContext ¶ added in v1.9.0
func NewTestValueCreationContext(invokable common_utils.Invokable) *testValueCreationContext
NewTestValueCreationContext returns a value-creation context backed by a test-only storage that is shared across all NewTestValueCreationContext calls for the given invokable but is independent of the invokable's own storage. See testValueCreationStorages for why both invariants matter.
func NewUnmeteredInMemoryStorage ¶
func NewUnmeteredInMemoryStorage() interpreter.InMemoryStorage
func RequireValuesEqual ¶
func RequireValuesEqual(t testing.TB, context interpreter.ValueComparisonContext, expected, actual interpreter.Value)
func ValuesAreEqual ¶
func ValuesAreEqual(context interpreter.ValueComparisonContext, expected, actual interpreter.Value) bool
Types ¶
type DictionaryEntry ¶
type DictionaryEntry[K, V any] struct { Key K Value V }
func DictionaryEntries ¶
func DictionaryEntries[K, V any]( context interpreter.ContainerMutationContext, dict *interpreter.DictionaryValue, fromKey func(interpreter.Value) (K, bool), fromVal func(interpreter.Value) (V, bool), ) ([]DictionaryEntry[K, V], bool)
DictionaryEntries is similar to DictionaryKeyValues, attempting to map untyped Values to concrete values using the provided morphisms. If a conversion fails, then this function returns (nil, false). Useful in contexts when Cadence values need to be extracted into their go counterparts.