(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestAdd(t *testing.T) { |
| 11 | var a = 1 |
| 12 | var b = 2 |
| 13 | var expected = 3 |
| 14 | |
| 15 | actual := gotest.Add(a, b) |
| 16 | if actual != expected { |
| 17 | t.Errorf("Add(%d, %d) = %d; expected: %d", a, b, actual, expected) |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | // TestArgs 用于演示如何解析-args参数 |
| 22 | func TestArgs(t *testing.T) { |