compare

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 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 CompareParams) []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 CompareQuery

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

Types

type CompareParams

type CompareParams 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