Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gravityblast/miniassert

Mini assert testing framework for the Go language
https://github.com/gravityblast/miniassert

Last synced: about 10 hours ago
JSON representation

Mini assert testing framework for the Go language

Awesome Lists containing this project

README

        

# miniassert

Mini assert testing framework for the Go language

## 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.

## Author

* [Andrea Franz](http://gravityblast.com)