Documentation ¶
Index ¶
- func Assert(tb testing.TB, condition bool, msg string, v ...interface{})
- func AssertNow(tb testing.TB, condition bool, msg string, v ...interface{})
- func Equals(tb testing.TB, exp, act interface{})
- func EqualsNow(tb testing.TB, exp, act interface{})
- func Ok(tb testing.TB, err error)
- func OkNow(tb testing.TB, err error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Assert ¶
Assert fails the test if the condition is false with tb.Fail
Example ¶
assertions.Assert(&mockTB{}, 3 == 4, "custom message %s%s", "custom str 2", "custom strings")
Output: �[31mexample_assertions_test.go:20: custom message custom str 2custom strings�[39m
func AssertNow ¶
AssertNow fails the test if the condition is false with tb.FailNow
Example ¶
assertions.AssertNow(&mockTB{}, 3 == 4, "custom message %s%s", "custom str 2", "custom strings")
Output: �[31mexample_assertions_test.go:25: custom message custom str 2custom strings�[39m
func Equals ¶
Equals fails the test if exp is not equal to act
Example (Int) ¶
assertions.Equals(&mockTB{}, 44, 23) /* Output: �[31mexample_assertions_test.go:30: exp: 44 got: 23�[39m */
Output: �[31mexample_assertions_test.go:30: exp: 44 got: 23�[39m
Example (Map) ¶
map1 := map[string]int{"dsds": 33, "lol": 420} map2 := map[string]int{"dsds": 3, "ll": 420} assertions.Equals(&mockTB{}, map1, map2) /* Output: �[31mexample_assertions_test.go:42: exp: map[string]int{"dsds":33, "lol":420} got: map[string]int{"dsds":3, "ll":420}�[39m */
Output: �[31mexample_assertions_test.go:42: exp: map[string]int{"dsds":33, "lol":420} got: map[string]int{"dsds":3, "ll":420}�[39m
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.