dagtest

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequireGraphEqual

func RequireGraphEqual[Key Ordered](
	t *testing.T,
	expected []ExpectedNode[Key],
	graph *dag.Graph[Key],
)

RequireGraphEqual requires that the graph equals the given ExpectedNodes.

The order of the input ExpectedNodes does not matter, and the order of the outbound Keys does not matter.

Types

type ExpectedNode

type ExpectedNode[Key Ordered] struct {
	Key      Key
	Outbound []Key
}

type Ordered

type Ordered interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64 |
		~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr |
		~float32 | ~float64 |
		~string
}

Ordered matches cmp.Ordered until we only support Go versions >= 1.21.

TODO: remove and replace with cmp.Ordered when we only support Go versions >= 1.21.

Jump to

Keyboard shortcuts

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