1// Package assert provides a set of comprehensive testing tools for use with the normal Go testing system.
5// The following is a complete example using assert in a standard test function:
9// "github.com/stretchr/testify/assert"
12// func TestSomething(t *testing.T) {
14// var a string = "Hello"
15// var b string = "Hello"
17// assert.Equal(t, a, b, "The two words should be the same.")
21// if you assert many times, use the format below:
25// "github.com/stretchr/testify/assert"
28// func TestSomething(t *testing.T) {
29// assert := assert.New(t)
31// var a string = "Hello"
32// var b string = "Hello"
34// assert.Equal(a, b, "The two words should be the same.")
39// Assertions allow you to easily write test code, and are global funcs in the `assert` package.
40// All assertion functions take, as the first argument, the `*testing.T` object provided by the
41// testing framework. This allows the assertion funcs to write the failings and other details to
44// Every assertion function also takes an optional string message as the final argument,
45// allowing custom error messages to be appended to the message the assertion method outputs.
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list