mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
Added HasAll utility method for string set.
Added HasAll method which detects if one set contains all of the memebers of another set. A.HasAll(B) returns true if A is a superset of B.
This commit is contained in:
@@ -34,7 +34,8 @@ func TestValidateVolumes(t *testing.T) {
|
||||
if len(errs) != 0 {
|
||||
t.Errorf("expected success: %v", errs)
|
||||
}
|
||||
if len(names) != 4 || !names.Has("abc") || !names.Has("123") || !names.Has("abc-123") || !names.Has("empty") {
|
||||
expectedSet := util.NewStringSet("abc", "123", "abc-123", "empty")
|
||||
if len(names) != 4 || !names.HasAll(expectedSet) {
|
||||
t.Errorf("wrong names result: %v", names)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user