pkg/storage: add unit test for keys

Signed-off-by: Zhou Hao <zhouhao@cn.fujitsu.com>
pull/7662/head
Zhou Hao 6 years ago
parent 7f3339cb4e
commit 41e0d3a7df

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

Loading…
Cancel
Save