Fix readme.
This commit is contained in:
parent
063b5e9764
commit
39c638aa2f
1 changed files with 5 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
||||||
## testequal
|
## testequal
|
||||||
|
|
||||||
В этой задаче нужно реализовать 4 test helper'а аналогичных функциям из [testify](https://github.com/stretchr/testify):
|
В этой задаче нужно реализовать 4 test helper'а, аналогичных функциям из [testify](https://github.com/stretchr/testify):
|
||||||
|
|
||||||
```
|
```
|
||||||
func AssertEqual(t T, expected, actual interface{}, msgAndArgs ...interface{}) bool
|
func AssertEqual(t T, expected, actual interface{}, msgAndArgs ...interface{}) bool
|
||||||
|
@ -9,22 +9,22 @@ func RequireEqual(t T, expected, actual interface{}, msgAndArgs ...interface{})
|
||||||
func RequireNotEqual(t T, expected, actual interface{}, msgAndArgs ...interface{})
|
func RequireNotEqual(t T, expected, actual interface{}, msgAndArgs ...interface{})
|
||||||
```
|
```
|
||||||
|
|
||||||
Пример теста:
|
Пример использования:
|
||||||
```
|
```
|
||||||
func TestMath(t *testing.T) {
|
func TestMath(t *testing.T) {
|
||||||
AssertEqual(t, 1, 2, "1 == 2")
|
AssertEqual(t, 1, 2, "1 == 2")
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
вывод:
|
вывод теста:
|
||||||
```
|
```
|
||||||
=== RUN TestMath
|
=== RUN TestMath
|
||||||
--- FAIL: TestMath (0.00s)
|
--- FAIL: TestMath (0.00s)
|
||||||
helper_test.go:43: not equal:
|
math_test.go:43: not equal:
|
||||||
expected: 1
|
expected: 1
|
||||||
actual : 2
|
actual : 2
|
||||||
message : 1 == 2
|
message : 1 == 2
|
||||||
FAIL
|
FAIL
|
||||||
FAIL gitlab.com/slon/shad-go/require 0.003s
|
FAIL gitlab.com/slon/shad-go/testequal 0.003s
|
||||||
FAIL
|
FAIL
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue