diff --git a/pkg/storage/driver/labels_test.go b/pkg/storage/driver/labels_test.go index bfd80911b..636d12176 100644 --- a/pkg/storage/driver/labels_test.go +++ b/pkg/storage/driver/labels_test.go @@ -17,6 +17,8 @@ limitations under the License. package driver // import "helm.sh/helm/v3/pkg/storage/driver" import ( + "reflect" + "sort" "testing" ) @@ -47,3 +49,14 @@ func TestLabelsMatch(t *testing.T) { } } } + +func TestLabelsKeys(t *testing.T) { + var test = labels(map[string]string{"KEY_A": "VAL_A", "KEY_B": "VAL_B"}) + var expect = []string{"KEY_A", "KEY_B"} + + result := test.keys() + sort.Strings(result) + if !reflect.DeepEqual(expect, result) { + t.Fatalf("Expected %v, got %v", expect, result) + } +}