assert

package module
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2018 License: MIT Imports: 4 Imported by: 0

README

assert

Build Status codecov

Package assert provides often use asserter

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

func Test_Example(t *testing.T) {
    assert := assert.NewTester(t)

    assert.Eq(1, 1)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tester

type Tester struct {
	// contains filtered or unexported fields
}

Tester provides assertion for testing

func NewTester

func NewTester(t *testing.T) *Tester

NewTester return a new Tester

func (*Tester) Assert

func (tr *Tester) Assert(condition bool)

Assert reports error when condition fail

func (*Tester) Eq

func (tr *Tester) Eq(actual, expect interface{})

Eq create the error report when actual != expected

func (*Tester) IsFalse

func (tr *Tester) IsFalse(condition bool)

func (*Tester) IsTrue

func (tr *Tester) IsTrue(condition bool)

func (*Tester) NoErr

func (tr *Tester) NoErr(err error)

func (*Tester) NotEq

func (tr *Tester) NotEq(actual, expectedNot interface{})

Eq create the error report when actual == expectedNot

Jump to

Keyboard shortcuts

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