assert

package
v3.0.4+incompatible Latest Latest
Warning

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

Go to latest
Published: May 25, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

README

Assert (c) Blake Mizerany and Keith Rarick -- MIT LICENCE

Assertions for Go tests

Install

$ go get github.com/bmizerany/assert

Use

point.go

package point

type Point struct {
    x, y int
}

point_test.go

package point

import (
    "testing"
    "github.com/bmizerany/assert"
)

func TestAsserts(t *testing.T) {
    p1 := Point{1, 1}
    p2 := Point{2, 1}

    assert.Equal(t, p1, p2)
}

output $ go test --- FAIL: TestAsserts (0.00 seconds) assert.go:15: /Users/flavio.barbosa/dev/stewie/src/point_test.go:12 assert.go:24: ! X: 1 != 2 FAIL

Docs

http://github.com/bmizerany/assert

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal(t *testing.T, exp, got interface{}, args ...interface{})

func Equalf

func Equalf(t *testing.T, exp, got interface{}, format string, args ...interface{})

func NotEqual

func NotEqual(t *testing.T, exp, got interface{}, args ...interface{})

func Panic

func Panic(t *testing.T, err interface{}, fn func())

func T

func T(t *testing.T, result bool, args ...interface{})

func Tf

func Tf(t *testing.T, result bool, format string, args ...interface{})

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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