subset

package module
v0.0.0-...-c811ad8 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: BSD-3-Clause Imports: 1 Imported by: 10

README

subset Build Status

Check if a value is a subset of another, based on reflect/deepequals.go. Documentation: http://godoc.org/github.com/facebookgo/subset

Documentation

Overview

Package subset implements logic to check if a value is a subset of another using reflect.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert(t Fatalf, expected interface{}, actual interface{})

Assert will fatal if not a subset with a useful message. TODO should pretty print and show a colored side-by-side diff?

func Check

func Check(expected, target interface{}) bool

Check tests for deep subset. It uses normal == equality where possible but will scan members of arrays, slices, maps, and fields of structs. It correctly handles recursive types. Functions are equal only if they are both nil.

Types

type Fatalf

type Fatalf interface {
	Fatalf(format string, args ...interface{})
}

Fatalf is how our assertion will fail.

Jump to

Keyboard shortcuts

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