Update messages to want/got for unit tests

This is the style used in the openfaas project.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis (OpenFaaS Ltd) 2021-09-16 10:44:36 +01:00
parent 5aa4c69e03
commit 3fe0d8d8d3
2 changed files with 4 additions and 4 deletions

View File

@ -53,7 +53,7 @@ func Test_BuildLabels_WithAnnotations(t *testing.T) {
} }
if !reflect.DeepEqual(val, tc.result) { if !reflect.DeepEqual(val, tc.result) {
t.Errorf("Got: %s, expected %s", val, tc.result) t.Errorf("Want: %s, got: %s", val, tc.result)
} }
}) })
} }

View File

@ -23,7 +23,7 @@ func Test_getRequestNamespace(t *testing.T) {
t.Run(tc.name, func(t *testing.T) { t.Run(tc.name, func(t *testing.T) {
actualNamespace := getRequestNamespace(tc.requestNamespace) actualNamespace := getRequestNamespace(tc.requestNamespace)
if actualNamespace != tc.expectedNamespace { if actualNamespace != tc.expectedNamespace {
t.Errorf("Got: %s, expected %s", actualNamespace, tc.expectedNamespace) t.Errorf("Want: %s, got: %s", actualNamespace, tc.expectedNamespace)
} }
}) })
} }
@ -44,7 +44,7 @@ func Test_getNamespaceSecretMountPath(t *testing.T) {
t.Run(tc.name, func(t *testing.T) { t.Run(tc.name, func(t *testing.T) {
actualNamespace := getNamespaceSecretMountPath(userSecretPath, tc.requestNamespace) actualNamespace := getNamespaceSecretMountPath(userSecretPath, tc.requestNamespace)
if actualNamespace != tc.expectedSecretPath { if actualNamespace != tc.expectedSecretPath {
t.Errorf("Got: %s, expected %s", actualNamespace, tc.expectedSecretPath) t.Errorf("Want: %s, got: %s", actualNamespace, tc.expectedSecretPath)
} }
}) })
} }
@ -68,7 +68,7 @@ func Test_readNamespaceFromQuery(t *testing.T) {
actualNamespace := readNamespaceFromQuery(r) actualNamespace := readNamespaceFromQuery(r)
if actualNamespace != tc.expectedNamespace { if actualNamespace != tc.expectedNamespace {
t.Errorf("Got: %s, expected %s", actualNamespace, tc.expectedNamespace) t.Errorf("Want: %s, got: %s", actualNamespace, tc.expectedNamespace)
} }
}) })
} }