Reduce the minwidth of the cli table printer

For a few columns we want to have a smaller width and 10 is excessive.
parent 2548fb08
...@@ -171,7 +171,7 @@ func (test getContextsTest) run(t *testing.T) { ...@@ -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
} }
......
...@@ -264,7 +264,7 @@ func TestGetObjectsWithOpenAPIOutputFormatPresent(t *testing.T) { ...@@ -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) { ...@@ -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) { ...@@ -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 ...@@ -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) { ...@@ -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> ...@@ -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) { ...@@ -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> ...@@ -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 ...@@ -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) { ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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> ...@@ -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> ...@@ -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> ...@@ -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> ...@@ -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> ...@@ -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> ...@@ -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)
} }
} }
......
...@@ -22,7 +22,7 @@ import ( ...@@ -22,7 +22,7 @@ import (
) )
const ( const (
tabwriterMinWidth = 10 tabwriterMinWidth = 6
tabwriterWidth = 4 tabwriterWidth = 4
tabwriterPadding = 3 tabwriterPadding = 3
tabwriterPadChar = ' ' tabwriterPadChar = ' '
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment