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

Function sub1

source/gotest/subunit_test.go:10–19  ·  view source on GitHub ↗

sub1 为子测试,只做加法测试

(t *testing.T)

Source from the content-addressed store, hash-verified

8
9// sub1 为子测试,只做加法测试
10func sub1(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// sub2 为子测试,只做加法测试
22func sub2(t *testing.T) {

Callers

nothing calls this directly

Calls 1

AddFunction · 0.92

Tested by

no test coverage detected