mdtest

package
v0.14.6 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package mdtest includes some internal utilities for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckContents

func CheckContents[T any](t *testing.T, s Eacher[T], want []T)

CheckContents verifies that s contains the specified elements in order, or reports an error to t.

Types

type Eacher

type Eacher[T any] interface {
	Each(func(T) bool) bool
	Len() int
}

Eacher is the subset of Shared provided by iterable elements.

type Shared

type Shared[T any] interface {
	Clear()
	Peek(int) (T, bool)
	Each(func(T) bool) bool
	IsEmpty() bool
	Len() int
}

Shared is the shared interface implemented by various types in this module. It is defined here for use in interface satisfaction checks in tests.

Jump to

Keyboard shortcuts

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