From 0cc3f688d6d77b7a5b84189151ad2dca0267a300 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 4 Nov 2022 14:02:35 +0100 Subject: [PATCH] cli/command: use more descriptive const in test On failures, the output wasn't clear which side was "expected" and which side was "actual". Signed-off-by: Sebastiaan van Stijn --- cli/command/context_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/command/context_test.go b/cli/command/context_test.go index 0f5d9a88d2..7ef2157942 100644 --- a/cli/command/context_test.go +++ b/cli/command/context_test.go @@ -16,7 +16,8 @@ func TestDockerContextMetadataKeepAdditionalFields(t *testing.T) { } jsonBytes, err := json.Marshal(c) assert.NilError(t, err) - assert.Equal(t, `{"Description":"test","foo":"bar"}`, string(jsonBytes)) + const expected = `{"Description":"test","foo":"bar"}` + assert.Equal(t, string(jsonBytes), expected) var c2 DockerContext assert.NilError(t, json.Unmarshal(jsonBytes, &c2))