зеркало из https://github.com/github/vitess-gh.git
Fix test printings
This commit is contained in:
Родитель
2991a9d6d9
Коммит
ae04743ced
|
@ -49,16 +49,16 @@ func Tests(t *testing.T, im *qrpb.VTGateCallerID, ef *vtpb.CallerID) {
|
|||
|
||||
// Test GetXxx on nil receivers, should get all empty strings
|
||||
if u := GetUsername(ctxim); u != "" {
|
||||
t.Errorf("Expect empty string from (nil).GetUsername(), but got %v", u)
|
||||
t.Errorf("Expect empty string from GetUsername(nil), but got %v", u)
|
||||
}
|
||||
if p := GetPrincipal(ctxef); p != "" {
|
||||
t.Errorf("Expect empty string from (nil).GetPrincipal(), but got %v", p)
|
||||
t.Errorf("Expect empty string from GetPrincipal(nil), but got %v", p)
|
||||
}
|
||||
if c := GetComponent(ctxef); c != "" {
|
||||
t.Errorf("Expect empty string from (nil).GetComponent(), but got %v", c)
|
||||
t.Errorf("Expect empty string from GetComponent(nil), but got %v", c)
|
||||
}
|
||||
if s := GetSubcomponent(ctxef); s != "" {
|
||||
t.Errorf("Expect empty string from (nil).GetSubcomponent(), but got %v", s)
|
||||
t.Errorf("Expect empty string from GetSubcomponent(nil), but got %v", s)
|
||||
}
|
||||
|
||||
ctx = NewContext(ctx, ef, im)
|
||||
|
@ -68,7 +68,7 @@ func Tests(t *testing.T, im *qrpb.VTGateCallerID, ef *vtpb.CallerID) {
|
|||
t.Errorf("Expect %v from ImmediateCallerIDFromContext, but got %v", im, ctxim)
|
||||
}
|
||||
if u := GetUsername(im); u != FakeUsername {
|
||||
t.Errorf("Expect %v from im.Username(), but got %v", FakeUsername, u)
|
||||
t.Errorf("Expect %v from GetUsername(im), but got %v", FakeUsername, u)
|
||||
}
|
||||
|
||||
ctxef = EffectiveCallerIDFromContext(ctx)
|
||||
|
@ -77,12 +77,12 @@ func Tests(t *testing.T, im *qrpb.VTGateCallerID, ef *vtpb.CallerID) {
|
|||
t.Errorf("Expect %v from EffectiveCallerIDFromContext, but got %v", ef, ctxef)
|
||||
}
|
||||
if p := GetPrincipal(ef); p != FakePrincipal {
|
||||
t.Errorf("Expect %v from ef.Principal(), but got %v", FakePrincipal, p)
|
||||
t.Errorf("Expect %v from GetPrincipal(ef), but got %v", FakePrincipal, p)
|
||||
}
|
||||
if c := GetComponent(ef); c != FakeComponent {
|
||||
t.Errorf("Expect %v from ef.Component(), but got %v", FakeComponent, c)
|
||||
t.Errorf("Expect %v from GetComponent(ef), but got %v", FakeComponent, c)
|
||||
}
|
||||
if s := GetSubcomponent(ef); s != FakeSubcomponent {
|
||||
t.Errorf("Expect %v from ef.Subcomponent(), but got %v", FakeSubcomponent, s)
|
||||
t.Errorf("Expect %v from GetSubcomponent(ef), but got %v", FakeSubcomponent, s)
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче