using t.cleanup instead of t.run cleanup function

This commit is contained in:
p_caiwfeng
2022-02-02 16:23:39 +08:00
parent c65e9fa51c
commit 7b74b535ec

View File

@@ -33,7 +33,7 @@ var (
func TestFunctions(t *testing.T) {
t.Run(runtime.FuncForPC(reflect.ValueOf(PingPodIP).Pointer()).Name(), PingPodIP)
t.Run(runtime.FuncForPC(reflect.ValueOf(UDP).Pointer()).Name(), UDP)
t.Run("cancel", func(t *testing.T) { cancelFunc() })
t.Cleanup(cancelFunc)
}
func PingPodIP(t *testing.T) {