...
1
18
19 package grpctest
20
21 import (
22 "testing"
23
24 "google.golang.org/grpc/grpclog"
25 grpclogi "google.golang.org/grpc/internal/grpclog"
26 )
27
28 type s struct {
29 Tester
30 }
31
32 func Test(t *testing.T) {
33 RunSubTests(t, s{})
34 }
35
36 func (s) TestInfo(t *testing.T) {
37 grpclog.Info("Info", "message.")
38 }
39
40 func (s) TestInfoln(t *testing.T) {
41 grpclog.Infoln("Info", "message.")
42 }
43
44 func (s) TestInfof(t *testing.T) {
45 grpclog.Infof("%v %v.", "Info", "message")
46 }
47
48 func (s) TestInfoDepth(t *testing.T) {
49 grpclogi.InfoDepth(0, "Info", "depth", "message.")
50 }
51
52 func (s) TestWarning(t *testing.T) {
53 grpclog.Warning("Warning", "message.")
54 }
55
56 func (s) TestWarningln(t *testing.T) {
57 grpclog.Warningln("Warning", "message.")
58 }
59
60 func (s) TestWarningf(t *testing.T) {
61 grpclog.Warningf("%v %v.", "Warning", "message")
62 }
63
64 func (s) TestWarningDepth(t *testing.T) {
65 grpclogi.WarningDepth(0, "Warning", "depth", "message.")
66 }
67
68 func (s) TestError(t *testing.T) {
69 const numErrors = 10
70 TLogger.ExpectError("Expected error")
71 TLogger.ExpectError("Expected ln error")
72 TLogger.ExpectError("Expected formatted error")
73 TLogger.ExpectErrorN("Expected repeated error", numErrors)
74 grpclog.Error("Expected", "error")
75 grpclog.Errorln("Expected", "ln", "error")
76 grpclog.Errorf("%v %v %v", "Expected", "formatted", "error")
77 for i := 0; i < numErrors; i++ {
78 grpclog.Error("Expected repeated error")
79 }
80 }
81
View as plain text