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

Function sub2

source/gotest/subunit_test.go:22–31  ·  view source on GitHub ↗

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

(t *testing.T)

Source from the content-addressed store, hash-verified

20
21// sub2 为子测试,只做加法测试
22func sub2(t *testing.T) {
23 var a = 1
24 var b = 2
25 var expected = 3
26
27 actual := gotest.Add(a, b)
28 if actual != expected {
29 t.Errorf("Add(%d, %d) = %d; expected: %d", a, b, actual, expected)
30 }
31}
32
33// sub3 为子测试,只做加法测试
34func sub3(t *testing.T) {

Callers

nothing calls this directly

Calls 1

AddFunction · 0.92

Tested by

no test coverage detected