testutil

package
v0.0.0-...-c85edb6 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2019 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package testutil defines the testing utils such as asserting logs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertLogsContain

func AssertLogsContain(t *testing.T, hook *test.Hook, want string)

AssertLogsContain checks that the desired string is a subset of the current log output. Set exitOnFail to true to immediately exit the test on failure

func AssertLogsDoNotContain

func AssertLogsDoNotContain(t *testing.T, hook *test.Hook, want string)

AssertLogsDoNotContain is the inverse check of AssertLogsContain

func BitLength

func BitLength(b int) int

BitLength returns the length of the bitfield for a giben number of attesters in bytes.

func BitSetCount

func BitSetCount(bytes []byte) int

BitSetCount counts the number of 1s in a byte using the following algo: https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel

func CheckBit

func CheckBit(bitfield []byte, index int) (bool, error)

CheckBit checks if a bit in a bit field is one.

func WaitForLog

func WaitForLog(t *testing.T, hook *test.Hook, want string)

WaitForLog waits for the desired string to appear the logs within a time period. If it does not appear within the limit, the function will throw an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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