miniassert: github.com/pilu/miniassert Index | Files

package miniassert

import "github.com/pilu/miniassert"

package Miniassert is a small assert library.

Usage:

package hello

import (
  "testing"
  "errors"
  assert "github.com/pilu/miniassert"
)

type Foo struct {}

func Hello() string { return "Hello World" }

func TestSomething(t *testing.T) {
  assert.Equal(t, "Hello World", Hello())
  assert.True(t, true)
  assert.False(t, false)

  var err error
  assert.Nil(t, err)

  err = errors.New("foo")
  assert.NotNil(t, err)

  foo := &Foo{}
  assert.Type(t, "*hello.Foo", foo)
}

Run `go test` as usual.

Index

Package Files

assert.go doc.go utils.go

func Equal Uses

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

func False Uses

func False(t *testing.T, value interface{})

func Nil Uses

func Nil(t *testing.T, value interface{})

func NotEqual Uses

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

func NotNil Uses

func NotNil(t *testing.T, value interface{})

func True Uses

func True(t *testing.T, value interface{})

func Type Uses

func Type(t *testing.T, expectedType string, value interface{})

Package miniassert imports 4 packages (graph). Updated 2016-07-18. Refresh now. Tools for package owners.