matchers

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Path

type Path string

Path is a pathname matcher.

A value matches if it is the same as the matcher pattern or has the matcher pattern as a trailing component. For example, a pattern "abc/def" matches "abc/def" itself, "omg/abc/def", but not "abc/def/wtf", "abc/omg/def", or "xabc/def".

Both the pattern and the value are sanitized using path.Clean() before use.

The empty pattern "" matches only the empty value "".

func (Path) Matches

func (p Path) Matches(x interface{}) bool

Matches returns whether x is the matching pathname itself or ends with the matching pathname, inside another directory.

func (Path) String

func (p Path) String() string

String returns the string representation of this pathname matcher.

type Slice

type Slice []interface{}

Slice is a gomock matcher that matches elements of an array or slice against its own members at the corresponding positions. Each member item in a Slice may be a regular item or a gomock Matcher instance.

func (Slice) Matches

func (sm Slice) Matches(x interface{}) bool

Matches returns whether x is a slice with matching elements.

func (Slice) String

func (sm Slice) String() string

String returns the string representation of this slice matcher.

type Struct

type Struct map[string]interface{}

Struct is a struct member matcher.

func (Struct) Matches

func (sm Struct) Matches(x interface{}) bool

Matches returns whether all specified members match.

func (Struct) String

func (sm Struct) String() string

Jump to

Keyboard shortcuts

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