yamlpathtest

package
v0.0.0-...-fc0d1eb Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2025 License: Apache-2.0, MIT Imports: 3 Imported by: 0

Documentation

Overview

Package yamlpathtest provides test-double utilities to aid in testing code that leverages the yamlpath library.

This makes it possible to control what concrete yamlpath.YAMLPath instances return without requiring specific yaml constructs to do so.

Index

Constants

This section is empty.

Variables

View Source
var (
	// True is a YAMLPath that always returns a boolean truthy value.
	True = Bool(true)

	// False is a YAMLPath that always returns a boolean falsey value.
	False = Bool(false)
)

Functions

func Bool

func Bool(b bool) *yamlpath.YAMLPath

Bool returns a yamlpath.YAMLPath object that returns the given boolean.

func BoolSequence

func BoolSequence(bools ...bool) *yamlpath.YAMLPath

BoolSequence returns a yamlpath.YAMLPath object that returns a sequence containing the given booleans.

func Collection

func Collection(nodes ...*yaml.Node) *yamlpath.YAMLPath

Collection returns a yamlpath.YAMLPath object that returns the given nodes.

func Error

func Error(err error) *yamlpath.YAMLPath

Error returns a yamlpath.YAMLPath object that always returns the given error.

func Float

func Float(float float64) *yamlpath.YAMLPath

Float returns a yamlpath.YAMLPath object that returns the given float.

func FloatSequence

func FloatSequence(floats ...float64) *yamlpath.YAMLPath

FloatSequence returns a yamlpath.YAMLPath object that returns a sequence containing the given floats.

func Int

func Int(i int) *yamlpath.YAMLPath

Int returns a yamlpath.YAMLPath object that returns the given integer.

func IntSequence

func IntSequence(ints ...int) *yamlpath.YAMLPath

IntSequence returns a yamlpath.YAMLPath object that returns a sequence containing the given integers.

func Null

func Null() *yamlpath.YAMLPath

Null returns a yamlpath.YAMLPath object that returns a null value.

func Object

func Object(v any) *yamlpath.YAMLPath

Object returns a yamlpath.YAMLPath object that returns the given value.

func ObjectSequence

func ObjectSequence(vs ...any) *yamlpath.YAMLPath

ObjectSequence returns a yamlpath.YAMLPath object that returns a sequence containing the given values.

func String

func String(s string) *yamlpath.YAMLPath

String returns a yamlpath.YAMLPath object that returns the given string.

func StringSequence

func StringSequence(strings ...string) *yamlpath.YAMLPath

StringSequence returns a yamlpath.YAMLPath object that returns a sequence containing the given strings.

Types

This section is empty.

Jump to

Keyboard shortcuts

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