Skip to content

nstott/assert

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Assertions for Go tests

Install

$ goinstall 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

--- FAIL: point.TestAsserts
        /Users/blake/code/assert/example/point_test.go:12
        !  Expected: point.Point point.Point{x:1, y:1}
        !  Got:      point.Point point.Point{x:2, y:1}
FAIL

Docs

http://github.com/bmizerany/assert

About

Asserts to Go testing

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%