test_utils

package
v0.0.0-...-4e93fa3 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadJson

func LoadJson(t *testing.T, path string, v any)

func NewReaderHashSnarkFromFile

func NewReaderHashSnarkFromFile(api frontend.API, h snarkHash.FieldHasher, path string) snarkHash.FieldHasher

func PrettyPrintHashes

func PrettyPrintHashes(in string, out io.Writer)

PrettyPrintHashes reads a file of hashes and prints them in a human-readable format. if out is nil, it will print to os.Stdout

func PrettyPrintHashesToFile

func PrettyPrintHashesToFile(in, out string)

func RandIntN

func RandIntN(n int) int

func RandIntSliceN

func RandIntSliceN(length, n int) []int

func SlicesEqual

func SlicesEqual[T any](expected, actual []T) error

Types

type FakeTestingT

type FakeTestingT struct{}

func (FakeTestingT) Errorf

func (FakeTestingT) Errorf(format string, args ...interface{})

func (FakeTestingT) FailNow

func (FakeTestingT) FailNow()

type ReaderHash

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

ReaderHash is a wrapper around a hash.Hash that matches all writes with its input stream.

func NewReaderHashFromFile

func NewReaderHashFromFile(h hash.Hash, path string) *ReaderHash

func (*ReaderHash) BlockSize

func (r *ReaderHash) BlockSize() int

func (*ReaderHash) CloseFile

func (r *ReaderHash) CloseFile()

func (*ReaderHash) Reset

func (r *ReaderHash) Reset()

func (*ReaderHash) Size

func (r *ReaderHash) Size() int

func (*ReaderHash) Sum

func (r *ReaderHash) Sum(b []byte) []byte

func (*ReaderHash) Write

func (r *ReaderHash) Write(p []byte) (n int, err error)

type ReaderHashSnark

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

ReaderHashSnark is a wrapper around a FieldHasher that matches all writes with its input stream.

func (*ReaderHashSnark) CloseFile

func (r *ReaderHashSnark) CloseFile()

func (*ReaderHashSnark) Reset

func (r *ReaderHashSnark) Reset()

func (*ReaderHashSnark) Sum

func (*ReaderHashSnark) Write

func (r *ReaderHashSnark) Write(data ...frontend.Variable)

type WriterHash

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

WriterHash is a wrapper around a hash.Hash that duplicates all writes.

func NewWriterHashToFile

func NewWriterHashToFile(h hash.Hash, path string) *WriterHash

func (*WriterHash) BlockSize

func (w *WriterHash) BlockSize() int

func (*WriterHash) CloseFile

func (w *WriterHash) CloseFile()

func (*WriterHash) Reset

func (w *WriterHash) Reset()

func (*WriterHash) Size

func (w *WriterHash) Size() int

func (*WriterHash) Sum

func (w *WriterHash) Sum(b []byte) []byte

func (*WriterHash) Write

func (w *WriterHash) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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