MCPcopy
hub / github.com/RainbowMango/GoExpertProgramming / TestAdd

Function TestAdd

source/gotest/unit_test.go:10–19  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func 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参数
22func TestArgs(t *testing.T) {

Callers

nothing calls this directly

Calls 1

AddFunction · 0.92

Tested by

no test coverage detected