compare

package
v1.21.4 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(expected, actual interface{}, params Params) []error

Compare compares values as plain text It can be compared several ways:

  • Pure values: should be equal
  • Regex: try to compile 'expected' as regex and match 'actual' with it It activates on following syntax: $matchRegexp(%EXPECTED_VALUE%)

func Query added in v1.21.4

func Query(expected, actual []string) (bool, error)

Types

type Params added in v1.21.4

type Params struct {
	IgnoreValues         bool `json:"ignoreValues" yaml:"ignoreValues"`
	IgnoreArraysOrdering bool `json:"ignoreArraysOrdering" yaml:"ignoreArraysOrdering"`
	DisallowExtraFields  bool `json:"disallowExtraFields" yaml:"disallowExtraFields"`
	IgnoreDbOrdering     bool `json:"IgnoreDbOrdering" yaml:"ignoreDbOrdering"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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