confirm

package
v0.0.0-...-e8efe0d Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package confirm provides experimental assertion helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PathLabel

func PathLabel(pth *gnmipb.Path) string

PathLabel converts a gnmi Path to a string, or to an error indicator if that fails.

func Readable

func Readable(v interface{}) string

Readable is the same as fmt.Sprintf("%v", v), except that pointers to basic types will be formatted as e.g. "&42" instead of "0xc0000b6020", so that error messages are not useless.

func State

func State(t testing.TB, want, got ygot.ValidatedGoStruct)

State checks that every set value in want is present in got. Extra fields in got will be ignored (typically the state contains many more keys than just the ones we're setting).

DEPRECATED: experimental function

Types

type Change

type Change struct {
	Path    *gnmipb.Path
	Want    interface{}
	Missing bool
	Got     interface{}
}

Change represents a difference in value at the gNMI path.

func ExtractChanges

func ExtractChanges(diff *gnmipb.Notification, want, got ygot.ValidatedGoStruct) ([]*Change, error)

ExtractChanges turns a Notification into a collection of Change objects.

Jump to

Keyboard shortcuts

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