assert

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: MIT Imports: 6 Imported by: 0

README

Assert

GoDoc

This package provides an assert function for Go. It's designed to work exactly like assert in C.

Example

package my_test

import "github.com/tidwall/assert"

func TestMyThing(t *testing.T) {
    assert.Assert("hello" == "jello")
}

This will print the following message and abort the program.

Assertion failed: ("hello" == "jello"), function TestMyThing, file my_test.go, line 6.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert(expression bool)

Assert aborts the program if assertion is false.

Types

This section is empty.

Jump to

Keyboard shortcuts

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