assert

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2017 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-assert Build Status

Asserts to Go testing

View the docs.

Installation

$ go get github.com/frozzare/go-assert

Example

package mypack

import (
  "testing"
  "github.com/frozzare/go-assert"
)

func TestName(t *testing.T) {
  assert.Equal(t, "Foo", "Foo")
}

License

MIT © Fredrik Forsmo

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Empty added in v1.0.2

func Empty(t *testing.T, actual interface{}, msgAndArgs ...interface{}) bool

Empty checks if the given value is empty or not.

func Equal

func Equal(t *testing.T, expected, actual interface{}, msgAndArgs ...interface{}) bool

Equal compare the expected value with the actual value and determine if the values are the same.

func Fail

func Fail(t *testing.T, expected, actual interface{}, msgAndArgs ...interface{})

Fail logs a failed message.

func False

func False(t *testing.T, actual bool, msgAndArgs ...interface{}) bool

False checks if the given value is false or not.

func Nil

func Nil(t *testing.T, actual interface{}, msgAndArgs ...interface{}) bool

Nil checks if the given value is nil or not.

func NotEmpty added in v1.0.2

func NotEmpty(t *testing.T, actual interface{}, msgAndArgs ...interface{}) bool

NotEmpty checks if the given value is not empty or not.

func NotEqual

func NotEqual(t *testing.T, expected, actual interface{}, msgAndArgs ...interface{}) bool

NotEqual compare the expected value with the actual value and determine if the values are not the same.

func NotNil

func NotNil(t *testing.T, actual interface{}, msgAndArgs ...interface{}) bool

NotNil checks if the given value is not nil or not.

func True

func True(t *testing.T, actual bool, msgAndArgs ...interface{}) bool

True checks if the given value is true or not.

Types

This section is empty.

Jump to

Keyboard shortcuts

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