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 <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-11-04 14:02:35 +01:00
parent acb934cc9d
commit 0cc3f688d6
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 2 additions and 1 deletions

View File

@ -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))