vomtest

package
Version: v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2021 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package vomtest provides protocol conformance tests for the Vanadium Object Marshaller (VOM).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Label      string        // Label describes the entry
	ValueLabel string        // ValueLabel describes the Value
	Value      reflect.Value // Value for vom test
	Version    vom.Version   // Version of encoding
	HexType    string        // Hex bytes representing the type message(s).
	HexValue   string        // Hex bytes representing the value message.
}

Entry represents a test entry, which contains a value and hex bytes. The hex bytes represent the golden vom encoding of the value. Encoding tests encode the value and expect to get the hex bytes, while decoding tests decode the hex bytes and expect to get the value.

func AllFail

func AllFail() []Entry

AllFail returns all entries that fail encoding and decoding tests.

The -vomtest flag may be used to filter the returned entries.

func AllFailFunc

func AllFailFunc(fn func(e Entry) bool) []Entry

AllFailFunc returns the entries in AllFail where fn(e) returns true for each returned entry.

func AllPass

func AllPass() []Entry

AllPass returns all entries that pass encoding and decoding tests.

The -vomtest flag may be used to filter the returned entries.

func AllPassFunc

func AllPassFunc(fn func(e Entry) bool) []Entry

AllPassFunc returns the entries in AllPass where fn(e) returns true for each returned entry.

func (Entry) Bytes

func (e Entry) Bytes() []byte

Bytes returns the full binary bytes, including the version, types and value.

func (Entry) Hex

func (e Entry) Hex() string

Hex returns the full hex bytes, including the version, types and value.

func (Entry) HexVersion

func (e Entry) HexVersion() string

HexVersion returns the version as hex bytes.

func (Entry) Name

func (e Entry) Name() string

Name returns the name of the entry, which combines the entry and value labels.

func (Entry) TypeBytes

func (e Entry) TypeBytes() []byte

TypeBytes returns the binary bytes including the version and types. Returns a nil slice if no type messages are encoded.

func (Entry) ValueBytes

func (e Entry) ValueBytes() []byte

ValueBytes returns the binary bytes including the version and value.

Directories

Path Synopsis
internal
vomforever
Command vomforever is a tool that searches for bugs in vom.
Command vomforever is a tool that searches for bugs in vom.
vomtestgen
Command vomtestgen generates test cases for the vomtest package.
Command vomtestgen generates test cases for the vomtest package.

Jump to

Keyboard shortcuts

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