testdeep

package module
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2020 License: BSD-2-Clause Imports: 1 Imported by: 0

README

go-testdeep

Build Status Coverage Status Go Report Card GoDoc Version Mentioned in Awesome Go

go-testdeep

Extremely flexible golang deep comparison, extends the go testing package.

Latest news

Synopsis

Make golang tests easy, from simplest usage:

import (
  "testing"

  "github.com/maxatome/go-testdeep/td"
)

func TestMyFunc(t *testing.T) {
  td.Cmp(t, MyFunc(), &Info{Name: "Alice", Age: 42})
}

To a bit more complex one, allowing flexible comparisons using TestDeep operators:

import (
  "testing"

  "github.com/maxatome/go-testdeep/td"
)

func TestMyFunc(t *testing.T) {
  td.Cmp(t, MyFunc(), td.Struct(
    &Info{Name: "Alice"},
    td.StructFields{
      "Age": td.Between(40, 45),
    },
  ))
}

Or anchoring operators directly in literals, as in:

import (
  "testing"

  "github.com/maxatome/go-testdeep/td"
)

func TestMyFunc(tt *testing.T) {
  t := td.NewT(tt)

  t.Cmp(MyFunc(), &Info{
    Name: "Alice",
    Age:  t.Anchor(td.Between(40, 45)).(int),
  })
}

To most complex one, allowing to easily test HTTP API routes, using flexible operators:

import (
  "testing"
  "time"

  "github.com/maxatome/go-testdeep/helpers/tdhttp"
  "github.com/maxatome/go-testdeep/td"
)

type Person struct {
  ID        uint64    `json:"id"`
  Name      string    `json:"name"`
  Age       int       `json:"age"`
  CreatedAt time.Time `json:"created_at"`
}

func TestMyApi(t *testing.T) {
  var id uint64
  var createdAt time.Time

  testAPI := tdhttp.NewTestAPI(t, myAPI) // ← ①

  testAPI.PostJSON("/person", Person{Name: "Bob", Age: 42}). // ← ②
    Name("Create a new Person").
    CmpStatus(http.StatusCreated). // ← ③
    CmpJSONBody(td.JSON(`
// Note that comments are allowed
{
  "id":         $id,          // set by the API/DB
  "name":       "Bob",
  "age":        42,
  "created_at": "$createdAt", // set by the API/DB
}`,
      td.Tag("id", td.Catch(&id, td.NotZero())),        // ← ④
      td.Tag("created_at", td.All(                      // ← ⑤
        td.HasSuffix("Z"),                              // ← ⑥
        td.Smuggle(func(s string) (time.Time, error) {  // ← ⑦
          return time.Parse(time.RFC3339Nano, s)
        }, td.Catch(&createdAt, td.Between(testAPI.SentAt(), time.Now()))), // ← ⑧
      )),
    ))
  if !testAPI.Failed() {
    t.Logf("The new Person ID is %d and was created at %s", id, createdAt)
  }
}
  1. the API handler ready to be tested;
  2. the POST request with automatic JSON marshalling;
  3. the expected response HTTP status should be http.StatusCreated and the line just below, the body should match the JSON operator;
  4. for the $id placeholder, Catch its value: put it in id variable and check it is NotZero;
  5. for the $created_at placeholder, use the All operator. It combines several operators like a AND;
  6. check that $created_at date ends with "Z" using HasSuffix. As we expect a RFC3339 date, we require it in UTC time zone;
  7. convert $created_at date into a time.Time using a custom function thanks to the Smuggle operator;
  8. then Catch the resulting value: put it in createdAt variable and check it is greater or equal than testAPI.SentAt() (the time just before the request is handled) and lesser or equal than time.Now().

See tdhttp helper or the FAQ for details about HTTP API testing.

Example of produced error in case of mismatch:

error output

Description

go-testdeep is a go rewrite and adaptation of wonderful Test::Deep perl.

In golang, comparing data structure is usually done using reflect.DeepEqual or using a package that uses this function behind the scene.

This function works very well, but it is not flexible. Both compared structures must match exactly and when a difference is returned, it is up to the caller to display it. Not easy when comparing big data structures.

The purpose of go-testdeep, via the td package and its helpers, is to do its best to introduce this missing flexibility using "operators", when the expected value (or one of its component) cannot be matched exactly, mixed with some useful comparison functions.

See go-testdeep.zetta.rocks for details.

Installation

$ go get -u github.com/maxatome/go-testdeep

Helpers

The goal of helpers is to make use of go-testdeep even more powerful by providing common features using TestDeep operators behind the scene.

tdhttp or HTTP API testing helper

The package github.com/maxatome/go-testdeep/helpers/tdhttp provides some functions to easily test HTTP handlers.

See tdhttp documentation for details or FAQ for an example of use.

tdutil aka the helper of helpers

The package github.com/maxatome/go-testdeep/helpers/tdutil allows to write unit tests for go-testdeep helpers and so provides some helpful functions.

See tdutil for details.

See also

  • testify: a toolkit with common assertions and mocks that plays nicely with the standard library
  • go-cmp: package for comparing Go values in tests

License

go-testdeep is released under the BSD-style license found in the LICENSE file in the root directory of this source tree.

Internal function deepValueEqual is based on deepValueEqual from reflect golang package licensed under the BSD-style license found in the LICENSE file in the golang repository.

Uses two files (bypass.go & bypasssafe.go) from Go-spew which is licensed under the copyfree ISC License.

Public Domain Gopher provided by Egon Elbre. The Go gopher was designed by Renee French.

FAQ

See FAQ.

Documentation

Overview

Package testdeep allows extremely flexible deep comparison. It is built for testing.

It is a go rewrite and adaptation of wonderful Test::Deep perl module (see https://metacpan.org/pod/Test::Deep).

In golang, comparing data structure is usually done using reflect.DeepEqual or using a package that uses this function behind the scene.

This function works very well, but it is not flexible. Both compared structures must match exactly.

The purpose of go-testdeep is to do its best to introduce this missing flexibility using "operators" when the expected value (or one of its component) cannot be matched exactly.

See td/ directory → https://pkg.go.dev/github.com/maxatome/go-testdeep/td

All variables and types of testdeep package are aliases to respectively functions and types of github.com/maxatome/go-testdeep/td package. They are only here for compatibility purpose as

import "github.com/maxatome/go-testdeep/td"

should now be used, in preference of older, but still supported:

import td "github.com/maxatome/go-testdeep"

For easy HTTP API testing, see https://pkg.go.dev/github.com/maxatome/go-testdeep/helpers/tdhttp

Index

Constants

View Source
const (
	// BoundsInIn is a deprecated alias of github.com/maxatome/go-testdeep/td.BoundsInIn.
	BoundsInIn = td.BoundsInIn
	// BoundsInOut is a deprecated alias of github.com/maxatome/go-testdeep/td.BoundsInOut.
	BoundsInOut = td.BoundsInOut
	// BoundsOutIn is a deprecated alias of github.com/maxatome/go-testdeep/td.BoundsOutIn.
	BoundsOutIn = td.BoundsOutIn
	// BoundsOutOut is a deprecated alias of github.com/maxatome/go-testdeep/td.BoundsOutOut.
	BoundsOutOut = td.BoundsOutOut
)

Variables

View Source
var (
	// Cmp is a deprecated alias of github.com/maxatome/go-testdeep/td.Cmp.
	Cmp = td.Cmp
	// CmpDeeply is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpDeeply.
	CmpDeeply = td.CmpDeeply

	// CmpTrue is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpTrue.
	CmpTrue = td.CmpTrue
	// CmpFalse is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpFalse.
	CmpFalse = td.CmpFalse
	// CmpError is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpError.
	CmpError = td.CmpError
	// CmpNoError is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpNoError.
	CmpNoError = td.CmpNoError
	// CmpPanic is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpPanic.
	CmpPanic = td.CmpPanic
	// CmpNotPanic is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpNotPanic.
	CmpNotPanic = td.CmpNotPanic

	// EqDeeply is a deprecated alias of github.com/maxatome/go-testdeep/td.EqDeeply.
	EqDeeply = td.EqDeeply
	// EqDeeplyError is a deprecated alias of github.com/maxatome/go-testdeep/td.EqDeeplyError.
	EqDeeplyError = td.EqDeeplyError

	// AddAnchorableStructType is a deprecated alias of github.com/maxatome/go-testdeep/td.AddAnchorableStructType.
	AddAnchorableStructType = td.AddAnchorableStructType

	// NewT is a deprecated alias of github.com/maxatome/go-testdeep/td.NewT.
	NewT = td.NewT
	// Assert is a deprecated alias of github.com/maxatome/go-testdeep/td.Assert.
	Assert = td.Assert
	// Require is a deprecated alias of github.com/maxatome/go-testdeep/td.Require.
	Require = td.Require
	// AssertRequire is a deprecated alias of github.com/maxatome/go-testdeep/td.AssertRequire.
	AssertRequire = td.AssertRequire

	// CmpAll is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpAll.
	CmpAll = td.CmpAll
	// CmpAny is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpAny.
	CmpAny = td.CmpAny
	// CmpArray is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpArray.
	CmpArray = td.CmpArray
	// CmpArrayEach is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpArrayEach.
	CmpArrayEach = td.CmpArrayEach
	// CmpBag is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpBag.
	CmpBag = td.CmpBag
	// CmpBetween is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpBetween.
	CmpBetween = td.CmpBetween
	// CmpCap is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpCap.
	CmpCap = td.CmpCap
	// CmpCode is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpCode.
	CmpCode = td.CmpCode
	// CmpContains is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpContains.
	CmpContains = td.CmpContains
	// CmpContainsKey is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpContainsKey.
	CmpContainsKey = td.CmpContainsKey
	// CmpEmpty is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpEmpty.
	CmpEmpty = td.CmpEmpty
	// CmpGt is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpGt.
	CmpGt = td.CmpGt
	// CmpGte is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpGte.
	CmpGte = td.CmpGte
	// CmpHasPrefix is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpHasPrefix.
	CmpHasPrefix = td.CmpHasPrefix
	// CmpHasSuffix is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpHasSuffix.
	CmpHasSuffix = td.CmpHasSuffix
	// CmpIsa is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpIsa.
	CmpIsa = td.CmpIsa
	// CmpJSON is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpJSON.
	CmpJSON = td.CmpJSON
	// CmpKeys is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpKeys.
	CmpKeys = td.CmpKeys
	// CmpLax is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpLax.
	CmpLax = td.CmpLax
	// CmpLen is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpLen.
	CmpLen = td.CmpLen
	// CmpLt is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpLt.
	CmpLt = td.CmpLt
	// CmpLte is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpLte.
	CmpLte = td.CmpLte
	// CmpMap is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpMap.
	CmpMap = td.CmpMap
	// CmpMapEach is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpMapEach.
	CmpMapEach = td.CmpMapEach
	// CmpN is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpN.
	CmpN = td.CmpN
	// CmpNaN is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpNaN.
	CmpNaN = td.CmpNaN
	// CmpNil is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpNil.
	CmpNil = td.CmpNil
	// CmpNone is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpNone.
	CmpNone = td.CmpNone
	// CmpNot is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpNot.
	CmpNot = td.CmpNot
	// CmpNotAny is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpNotAny.
	CmpNotAny = td.CmpNotAny
	// CmpNotEmpty is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpNotEmpty.
	CmpNotEmpty = td.CmpNotEmpty
	// CmpNotNaN is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpNotNaN.
	CmpNotNaN = td.CmpNotNaN
	// CmpNotNil is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpNotNil.
	CmpNotNil = td.CmpNotNil
	// CmpNotZero is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpNotZero.
	CmpNotZero = td.CmpNotZero
	// CmpPPtr is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpPPtr.
	CmpPPtr = td.CmpPPtr
	// CmpPtr is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpPtr.
	CmpPtr = td.CmpPtr
	// CmpRe is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpRe.
	CmpRe = td.CmpRe
	// CmpReAll is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpReAll.
	CmpReAll = td.CmpReAll
	// CmpSet is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpSet.
	CmpSet = td.CmpSet
	// CmpShallow is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpShallow.
	CmpShallow = td.CmpShallow
	// CmpSlice is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpSlice.
	CmpSlice = td.CmpSlice
	// CmpSmuggle is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpSmuggle.
	CmpSmuggle = td.CmpSmuggle
	// CmpSStruct is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpSStruct.
	CmpSStruct = td.CmpSStruct
	// CmpString is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpString.
	CmpString = td.CmpString
	// CmpStruct is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpStruct.
	CmpStruct = td.CmpStruct
	// CmpSubBagOf is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpSubBagOf.
	CmpSubBagOf = td.CmpSubBagOf
	// CmpSubJSONOf is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpSubJSONOf.
	CmpSubJSONOf = td.CmpSubJSONOf
	// CmpSubMapOf is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpSubMapOf.
	CmpSubMapOf = td.CmpSubMapOf
	// CmpSubSetOf is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpSubSetOf.
	CmpSubSetOf = td.CmpSubSetOf
	// CmpSuperBagOf is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpSuperBagOf.
	CmpSuperBagOf = td.CmpSuperBagOf
	// CmpSuperJSONOf is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpSuperJSONOf.
	CmpSuperJSONOf = td.CmpSuperJSONOf
	// CmpSuperMapOf is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpSuperMapOf.
	CmpSuperMapOf = td.CmpSuperMapOf
	// CmpSuperSetOf is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpSuperSetOf.
	CmpSuperSetOf = td.CmpSuperSetOf
	// CmpTruncTime is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpTruncTime.
	CmpTruncTime = td.CmpTruncTime
	// CmpValues is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpValues.
	CmpValues = td.CmpValues
	// CmpZero is a deprecated alias of github.com/maxatome/go-testdeep/td.CmpZero.
	CmpZero = td.CmpZero

	// All is a deprecated alias of github.com/maxatome/go-testdeep/td.All.
	All = td.All
	// Any is a deprecated alias of github.com/maxatome/go-testdeep/td.Any.
	Any = td.Any
	// Array is a deprecated alias of github.com/maxatome/go-testdeep/td.Array.
	Array = td.Array
	// ArrayEach is a deprecated alias of github.com/maxatome/go-testdeep/td.ArrayEach.
	ArrayEach = td.ArrayEach
	// Bag is a deprecated alias of github.com/maxatome/go-testdeep/td.Bag.
	Bag = td.Bag
	// Between is a deprecated alias of github.com/maxatome/go-testdeep/td.Between.
	Between = td.Between
	// Cap is a deprecated alias of github.com/maxatome/go-testdeep/td.Cap.
	Cap = td.Cap
	// Catch is a deprecated alias of github.com/maxatome/go-testdeep/td.Catch.
	Catch = td.Catch
	// Code is a deprecated alias of github.com/maxatome/go-testdeep/td.Code.
	Code = td.Code
	// Contains is a deprecated alias of github.com/maxatome/go-testdeep/td.Contains.
	Contains = td.Contains
	// ContainsKey is a deprecated alias of github.com/maxatome/go-testdeep/td.ContainsKey.
	ContainsKey = td.ContainsKey
	// Delay is a deprecated alias of github.com/maxatome/go-testdeep/td.ContainsKey.
	Delay = td.Delay
	// Empty is a deprecated alias of github.com/maxatome/go-testdeep/td.Empty.
	Empty = td.Empty
	// Gt is a deprecated alias of github.com/maxatome/go-testdeep/td.Gt.
	Gt = td.Gt
	// Gte is a deprecated alias of github.com/maxatome/go-testdeep/td.Gte.
	Gte = td.Gte
	// HasPrefix is a deprecated alias of github.com/maxatome/go-testdeep/td.HasPrefix.
	HasPrefix = td.HasPrefix
	// HasSuffix is a deprecated alias of github.com/maxatome/go-testdeep/td.HasSuffix.
	HasSuffix = td.HasSuffix
	// Ignore is a deprecated alias of github.com/maxatome/go-testdeep/td.Ignore.
	Ignore = td.Ignore
	// Isa is a deprecated alias of github.com/maxatome/go-testdeep/td.Isa.
	Isa = td.Isa
	// JSON is a deprecated alias of github.com/maxatome/go-testdeep/td.JSON.
	JSON = td.JSON
	// Keys is a deprecated alias of github.com/maxatome/go-testdeep/td.Keys.
	Keys = td.Keys
	// Lax is a deprecated alias of github.com/maxatome/go-testdeep/td.Lax.
	Lax = td.Lax
	// Len is a deprecated alias of github.com/maxatome/go-testdeep/td.Len.
	Len = td.Len
	// Lt is a deprecated alias of github.com/maxatome/go-testdeep/td.Lt.
	Lt = td.Lt
	// Lte is a deprecated alias of github.com/maxatome/go-testdeep/td.Lte.
	Lte = td.Lte
	// Map is a deprecated alias of github.com/maxatome/go-testdeep/td.Map.
	Map = td.Map
	// MapEach is a deprecated alias of github.com/maxatome/go-testdeep/td.MapEach.
	MapEach = td.MapEach
	// N is a deprecated alias of github.com/maxatome/go-testdeep/td.N.
	N = td.N
	// NaN is a deprecated alias of github.com/maxatome/go-testdeep/td.NaN.
	NaN = td.NaN
	// Nil is a deprecated alias of github.com/maxatome/go-testdeep/td.Nil.
	Nil = td.Nil
	// None is a deprecated alias of github.com/maxatome/go-testdeep/td.None.
	None = td.None
	// Not is a deprecated alias of github.com/maxatome/go-testdeep/td.Not.
	Not = td.Not
	// NotAny is a deprecated alias of github.com/maxatome/go-testdeep/td.NotAny.
	NotAny = td.NotAny
	// NotEmpty is a deprecated alias of github.com/maxatome/go-testdeep/td.NotEmpty.
	NotEmpty = td.NotEmpty
	// NotNaN is a deprecated alias of github.com/maxatome/go-testdeep/td.NotNaN.
	NotNaN = td.NotNaN
	// NotNil is a deprecated alias of github.com/maxatome/go-testdeep/td.NotNil.
	NotNil = td.NotNil
	// NotZero is a deprecated alias of github.com/maxatome/go-testdeep/td.NotZero.
	NotZero = td.NotZero
	// Ptr is a deprecated alias of github.com/maxatome/go-testdeep/td.Ptr.
	Ptr = td.Ptr
	// PPtr is a deprecated alias of github.com/maxatome/go-testdeep/td.PPtr.
	PPtr = td.PPtr
	// Re is a deprecated alias of github.com/maxatome/go-testdeep/td.Re.
	Re = td.Re
	// ReAll is a deprecated alias of github.com/maxatome/go-testdeep/td.ReAll.
	ReAll = td.ReAll
	// Set is a deprecated alias of github.com/maxatome/go-testdeep/td.Set.
	Set = td.Set
	// Shallow is a deprecated alias of github.com/maxatome/go-testdeep/td.Shallow.
	Shallow = td.Shallow
	// Slice is a deprecated alias of github.com/maxatome/go-testdeep/td.Slice.
	Slice = td.Slice
	// Smuggle is a deprecated alias of github.com/maxatome/go-testdeep/td.Smuggle.
	Smuggle = td.Smuggle
	// String is a deprecated alias of github.com/maxatome/go-testdeep/td.String.
	String = td.String
	// SStruct is a deprecated alias of github.com/maxatome/go-testdeep/td.SStruct.
	SStruct = td.SStruct
	// Struct is a deprecated alias of github.com/maxatome/go-testdeep/td.Struct.
	Struct = td.Struct
	// SubBagOf is a deprecated alias of github.com/maxatome/go-testdeep/td.SubBagOf.
	SubBagOf = td.SubBagOf
	// SubJSONOf is a deprecated alias of github.com/maxatome/go-testdeep/td.SubJSONOf.
	SubJSONOf = td.SubJSONOf
	// SubMapOf is a deprecated alias of github.com/maxatome/go-testdeep/td.SubMapOf.
	SubMapOf = td.SubMapOf
	// SubSetOf is a deprecated alias of github.com/maxatome/go-testdeep/td.SubSetOf.
	SubSetOf = td.SubSetOf
	// SuperBagOf is a deprecated alias of github.com/maxatome/go-testdeep/td.SuperBagOf.
	SuperBagOf = td.SuperBagOf
	// SuperJSONOf is a deprecated alias of github.com/maxatome/go-testdeep/td.SuperJSONOf.
	SuperJSONOf = td.SuperJSONOf
	// SuperMapOf is a deprecated alias of github.com/maxatome/go-testdeep/td.SuperMapOf.
	SuperMapOf = td.SuperMapOf
	// SuperSetOf is a deprecated alias of github.com/maxatome/go-testdeep/td.SuperSetOf.
	SuperSetOf = td.SuperSetOf
	// Tag is a deprecated alias of github.com/maxatome/go-testdeep/td.Tag.
	Tag = td.Tag
	// TruncTime is a deprecated alias of github.com/maxatome/go-testdeep/td.TruncTime.
	TruncTime = td.TruncTime
	// Values is a deprecated alias of github.com/maxatome/go-testdeep/td.Values.
	Values = td.Values
	// Zero is a deprecated alias of github.com/maxatome/go-testdeep/td.Zero.
	Zero = td.Zero
)

Functions

This section is empty.

Types

type ArrayEntries

type ArrayEntries = td.ArrayEntries

ArrayEntries is a deprecated alias of github.com/maxatome/go-testdeep/td.ArrayEntries.

type BoundsKind

type BoundsKind = td.BoundsKind

BoundsKind is a deprecated alias of github.com/maxatome/go-testdeep/td.BoundsKind.

type ContextConfig

type ContextConfig = td.ContextConfig

ContextConfig is a deprecated alias of github.com/maxatome/go-testdeep/td.ContextConfig.

type MapEntries

type MapEntries = td.MapEntries

MapEntries is a deprecated alias of github.com/maxatome/go-testdeep/td.MapEntries.

type SmuggledGot

type SmuggledGot = td.SmuggledGot

SmuggledGot is a deprecated alias of github.com/maxatome/go-testdeep/td.SmuggledGot.

type StructFields

type StructFields = td.StructFields

StructFields is a deprecated alias of github.com/maxatome/go-testdeep/td.StructFields.

type T

type T = td.T

T is a deprecated alias of github.com/maxatome/go-testdeep/td.T.

type TestDeep

type TestDeep = td.TestDeep

TestDeep is a deprecated alias of github.com/maxatome/go-testdeep/td.TestDeep.

type TestingFT

type TestingFT = td.TestingFT

TestingFT is a deprecated alias of github.com/maxatome/go-testdeep/td.TestingFT, which is itself a deprecated alias of testing.TB.

type TestingT

type TestingT = td.TestingT

TestingT is a deprecated alias of github.com/maxatome/go-testdeep/td.TestingT.

Directories

Path Synopsis
helpers
tdhttp
Package tdhttp provides some functions to easily test HTTP handlers.
Package tdhttp provides some functions to easily test HTTP handlers.
tdutil
Package tdutil allows to write unit tests for go-testdeep helpers and so provides some helpful functions.
Package tdutil allows to write unit tests for go-testdeep helpers and so provides some helpful functions.
internal
Package td (aka go-testdeep) allows extremely flexible deep comparison, it is built for testing.
Package td (aka go-testdeep) allows extremely flexible deep comparison, it is built for testing.

Jump to

Keyboard shortcuts

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