gocheck2

package
v0.0.0-...-e863c70 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2019 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Extensions to the go-check unittest framework.

NOTE: see https://github.com/go-check/check/pull/6 for reasons why these checkers live here.

Index

Constants

This section is empty.

Variables

View Source
var BytesEquals = &bytesEquals{}

BytesEquals checker compares two bytes sequence using bytes.Equal.

For example:

c.Assert(b, BytesEquals, []byte("bar"))

Main difference between DeepEquals and BytesEquals is that BytesEquals treats `nil` as empty byte sequence while DeepEquals doesn't.

c.Assert(nil, BytesEquals, []byte("")) // succeeds
c.Assert(nil, DeepEquals, []byte("")) // fails
View Source
var HasKey = &hasKey{}

The HasKey checker verifies that the obtained map contains the given key.

For example:

c.Assert(myMap, HasKey, "foo")
View Source
var IsFalse Checker = &isBoolValueChecker{
	&CheckerInfo{Name: "IsFalse", Params: []string{"obtained"}},
	false,
}

The IsFalse checker verifies that the obtained value is false.

For example:

c.Assert(value, IsFalse)
View Source
var IsTrue Checker = &isBoolValueChecker{
	&CheckerInfo{Name: "IsTrue", Params: []string{"obtained"}},
	true,
}

The IsTrue checker verifies that the obtained value is true.

For example:

c.Assert(value, IsTrue)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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