From 9ecab7e20c0b64e27dd108c2c613568d8b2d6b7b Mon Sep 17 00:00:00 2001 From: zhengjiajin <393926893@qq.com> Date: Fri, 19 May 2017 02:04:59 +0800 Subject: [PATCH] clean up: put test description in head to locate quickly --- pkg/kubectl/cmd/attach_test.go | 8 ++++---- pkg/kubectl/cmd/exec_test.go | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/kubectl/cmd/attach_test.go b/pkg/kubectl/cmd/attach_test.go index d5f32249380..bbe04e26fd6 100644 --- a/pkg/kubectl/cmd/attach_test.go +++ b/pkg/kubectl/cmd/attach_test.go @@ -157,19 +157,19 @@ func TestPodAndContainerAttach(t *testing.T) { err := options.Complete(f, cmd, test.args) if test.expectError && err == nil { - t.Errorf("unexpected non-error (%s)", test.name) + t.Errorf("%s: unexpected non-error", test.name) } if !test.expectError && err != nil { - t.Errorf("unexpected error: %v (%s)", err, test.name) + t.Errorf("%s: unexpected error: %v", test.name, err) } if err != nil { continue } if options.PodName != test.expectedPod { - t.Errorf("expected: %s, got: %s (%s)", test.expectedPod, options.PodName, test.name) + t.Errorf("%s: expected: %s, got: %s", test.name, test.expectedPod, options.PodName) } if options.ContainerName != test.expectedContainer { - t.Errorf("expected: %s, got: %s (%s)", test.expectedContainer, options.ContainerName, test.name) + t.Errorf("%s: expected: %s, got: %s", test.name, test.expectedContainer, options.ContainerName) } } } diff --git a/pkg/kubectl/cmd/exec_test.go b/pkg/kubectl/cmd/exec_test.go index 9b50f9c6dc5..8d72c724bc4 100644 --- a/pkg/kubectl/cmd/exec_test.go +++ b/pkg/kubectl/cmd/exec_test.go @@ -141,22 +141,22 @@ func TestPodAndContainer(t *testing.T) { options := test.p err := options.Complete(f, cmd, test.args, test.argsLenAtDash) if test.expectError && err == nil { - t.Errorf("unexpected non-error (%s)", test.name) + t.Errorf("%s: unexpected non-error", test.name) } if !test.expectError && err != nil { - t.Errorf("unexpected error: %v (%s)", err, test.name) + t.Errorf("%s: unexpected error: %v", test.name, err) } if err != nil { continue } if options.PodName != test.expectedPod { - t.Errorf("expected: %s, got: %s (%s)", test.expectedPod, options.PodName, test.name) + t.Errorf("%s: expected: %s, got: %s", test.name, test.expectedPod, options.PodName) } if options.ContainerName != test.expectedContainer { - t.Errorf("expected: %s, got: %s (%s)", test.expectedContainer, options.ContainerName, test.name) + t.Errorf("%s: expected: %s, got: %s", test.name, test.expectedContainer, options.ContainerName) } if !reflect.DeepEqual(test.expectedArgs, options.Command) { - t.Errorf("expected: %v, got %v (%s)", test.expectedArgs, options.Command, test.name) + t.Errorf("%s: expected: %v, got %v", test.name, test.expectedArgs, options.Command) } } }