Reduce the minwidth of the cli table printer

For a few columns we want to have a smaller width and 10 is excessive.
This commit is contained in:
Clayton Coleman 2018-08-28 14:57:40 -04:00
parent 2548fb08cd
commit 02099f445b
No known key found for this signature in database
GPG Key ID: 3D16906B4F1C5CB3
4 changed files with 85 additions and 85 deletions

View File

@ -171,7 +171,7 @@ func (test getContextsTest) run(t *testing.T) {
cmd.Run(cmd, test.names) cmd.Run(cmd, test.names)
if len(test.expectedOut) != 0 { if len(test.expectedOut) != 0 {
if buf.String() != test.expectedOut { if buf.String() != test.expectedOut {
t.Errorf("Expected %v, but got %v", test.expectedOut, buf.String()) t.Errorf("Expected\n%s\ngot\n%s", test.expectedOut, buf.String())
} }
return return
} }

View File

@ -264,7 +264,7 @@ func TestGetObjectsWithOpenAPIOutputFormatPresent(t *testing.T) {
foo 10 foo 10
` `
if e, a := expected, buf.String(); e != a { if e, a := expected, buf.String(); e != a {
t.Errorf("expected %v, got %v", e, a) t.Errorf("expected\n%v\ngot\n%v", e, a)
} }
} }
@ -316,7 +316,7 @@ func TestGetObjects(t *testing.T) {
foo 0/0 0 <unknown> foo 0/0 0 <unknown>
` `
if e, a := expected, buf.String(); e != a { if e, a := expected, buf.String(); e != a {
t.Errorf("expected %v, got %v", e, a) t.Errorf("expected\n%v\ngot\n%v", e, a)
} }
} }
@ -342,7 +342,7 @@ func TestGetObjectsShowKind(t *testing.T) {
pod/foo 0/0 0 <unknown> pod/foo 0/0 0 <unknown>
` `
if e, a := expected, buf.String(); e != a { if e, a := expected, buf.String(); e != a {
t.Errorf("expected %v, got %v", e, a) t.Errorf("expected\n%v\ngot\n%v", e, a)
} }
} }
@ -401,7 +401,7 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/baz ClusterIP <none> <none> <none> <unknown> service/baz ClusterIP <none> <none> <none> <unknown>
` `
if e, a := expected, buf.String(); e != a { if e, a := expected, buf.String(); e != a {
t.Errorf("expected %v, got %v", e, a) t.Errorf("expected\n%v\ngot\n%v", e, a)
} }
} }
@ -427,7 +427,7 @@ func TestGetObjectsShowLabels(t *testing.T) {
foo 0/0 0 <unknown> <none> foo 0/0 0 <unknown> <none>
` `
if e, a := expected, buf.String(); e != a { if e, a := expected, buf.String(); e != a {
t.Errorf("expected %v, got %v", e, a) t.Errorf("expected\n%v\ngot\n%v", e, a)
} }
} }
@ -522,7 +522,7 @@ b 0/0 0 <unknown>
c 0/0 0 <unknown> c 0/0 0 <unknown>
` `
if e, a := expected, buf.String(); e != a { if e, a := expected, buf.String(); e != a {
t.Errorf("expected %v, got %v", e, a) t.Errorf("expected\n%v\ngot\n%v", e, a)
} }
} }
@ -548,7 +548,7 @@ func TestGetObjectsIdentifiedByFile(t *testing.T) {
foo 0/0 0 <unknown> foo 0/0 0 <unknown>
` `
if e, a := expected, buf.String(); e != a { if e, a := expected, buf.String(); e != a {
t.Errorf("expected %v, got %v", e, a) t.Errorf("expected\n%v\ngot\n%v", e, a)
} }
} }
@ -574,7 +574,7 @@ foo 0/0 0 <unknown>
bar 0/0 0 <unknown> bar 0/0 0 <unknown>
` `
if e, a := expected, buf.String(); e != a { if e, a := expected, buf.String(); e != a {
t.Errorf("expected %v, got %v", e, a) t.Errorf("expected\n%v\ngot\n%v", e, a)
} }
} }
@ -601,7 +601,7 @@ serverbad Unhealthy bad status: 500
serverunknown Unhealthy fizzbuzz error serverunknown Unhealthy fizzbuzz error
` `
if e, a := expected, buf.String(); e != a { if e, a := expected, buf.String(); e != a {
t.Errorf("expected %v, got %v", e, a) t.Errorf("expected\n%v\ngot\n%v", e, a)
} }
} }
@ -663,7 +663,7 @@ func TestGetMixedGenericObjects(t *testing.T) {
} }
` `
if e, a := expected, buf.String(); e != a { if e, a := expected, buf.String(); e != a {
t.Errorf("expected %v, got %v", e, a) t.Errorf("expected\n%v\ngot\n%v", e, a)
} }
} }
@ -701,7 +701,7 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/baz ClusterIP <none> <none> <none> <unknown> service/baz ClusterIP <none> <none> <none> <unknown>
` `
if e, a := expected, buf.String(); e != a { if e, a := expected, buf.String(); e != a {
t.Errorf("expected %v, got %v", e, a) t.Errorf("expected\n%v\ngot\n%v", e, a)
} }
} }
@ -843,7 +843,7 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/baz ClusterIP <none> <none> <none> <unknown> service/baz ClusterIP <none> <none> <none> <unknown>
` `
if e, a := expected, buf.String(); e != a { if e, a := expected, buf.String(); e != a {
t.Errorf("expected %v, got %v", e, a) t.Errorf("expected\n%v\ngot\n%v", e, a)
} }
} }
@ -886,7 +886,7 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/baz ClusterIP <none> <none> <none> <unknown> service/baz ClusterIP <none> <none> <none> <unknown>
` `
if e, a := expected, buf.String(); e != a { if e, a := expected, buf.String(); e != a {
t.Errorf("expected %v, got %v", e, a) t.Errorf("expected\n%v\ngot\n%v", e, a)
} }
} }
@ -929,7 +929,7 @@ NAME STATUS ROLES AGE VERSION
node/foo Unknown <none> <unknown> node/foo Unknown <none> <unknown>
` `
if e, a := expected, buf.String(); e != a { if e, a := expected, buf.String(); e != a {
t.Errorf("expected %v, got %v", e, a) t.Errorf("expected\n%v\ngot\n%v", e, a)
} }
} }
@ -1050,7 +1050,7 @@ foo 0/0 0 <unknown>
foo 0/0 0 <unknown> foo 0/0 0 <unknown>
` `
if e, a := expected, buf.String(); e != a { if e, a := expected, buf.String(); e != a {
t.Errorf("expected %v, got %v", e, a) t.Errorf("expected\n%v\ngot\n%v", e, a)
} }
} }
@ -1101,7 +1101,7 @@ foo 0/0 0 <unknown>
foo 0/0 0 <unknown> foo 0/0 0 <unknown>
` `
if e, a := expected, buf.String(); e != a { if e, a := expected, buf.String(); e != a {
t.Errorf("expected %v, got %v", e, a) t.Errorf("expected\n%v\ngot\n%v", e, a)
} }
} }
@ -1144,7 +1144,7 @@ foo 0/0 0 <unknown>
foo 0/0 0 <unknown> foo 0/0 0 <unknown>
` `
if e, a := expected, buf.String(); e != a { if e, a := expected, buf.String(); e != a {
t.Errorf("expected %v, got %v", e, a) t.Errorf("expected\n%v\ngot\n%v", e, a)
} }
} }
@ -1188,7 +1188,7 @@ foo 0/0 0 <unknown>
foo 0/0 0 <unknown> foo 0/0 0 <unknown>
` `
if e, a := expected, buf.String(); e != a { if e, a := expected, buf.String(); e != a {
t.Errorf("expected %v, got %v", e, a) t.Errorf("expected\n%v\ngot\n%v", e, a)
} }
} }
@ -1230,7 +1230,7 @@ foo 0/0 0 <unknown>
foo 0/0 0 <unknown> foo 0/0 0 <unknown>
` `
if e, a := expected, buf.String(); e != a { if e, a := expected, buf.String(); e != a {
t.Errorf("expected %v, got %v", e, a) t.Errorf("expected\n%v\ngot\n%v", e, a)
} }
} }
@ -1275,7 +1275,7 @@ foo 0/0 0 <unknown>
foo 0/0 0 <unknown> foo 0/0 0 <unknown>
` `
if e, a := expected, buf.String(); e != a { if e, a := expected, buf.String(); e != a {
t.Errorf("expected %v, got %v", e, a) t.Errorf("expected\n%v\ngot\n%v", e, a)
} }
} }

View File

@ -22,7 +22,7 @@ import (
) )
const ( const (
tabwriterMinWidth = 10 tabwriterMinWidth = 6
tabwriterWidth = 4 tabwriterWidth = 4
tabwriterPadding = 3 tabwriterPadding = 3
tabwriterPadChar = ' ' tabwriterPadChar = ' '