improvements to integration test organization

This commit is contained in:
Daniel Smith
2014-07-01 13:30:19 -07:00
parent da61f90b08
commit 50bbf39925
3 changed files with 65 additions and 29 deletions

View File

@@ -16,6 +16,10 @@ limitations under the License.
package util
import (
"sort"
)
type empty struct{}
// A set of strings, implemented via map[string]struct{} for minimal memory consumption.
@@ -45,3 +49,13 @@ func (s StringSet) Has(item string) bool {
_, contained := s[item]
return contained
}
// Return the contents as a sorted string slice.
func (s StringSet) List() []string {
res := make([]string, 0, len(s))
for key := range s {
res = append(res, key)
}
sort.StringSlice(res).Sort()
return res
}