Sort tags so output is deterministic.
This commit is contained in:
parent
1f8c79cdb5
commit
3c5a36357c
|
@ -123,6 +123,7 @@ func (c *CatalogListServicesCommand) Run(args []string) int {
|
|||
var b bytes.Buffer
|
||||
tw := tabwriter.NewWriter(&b, 0, 2, 6, ' ', 0)
|
||||
for _, s := range order {
|
||||
sort.Strings(services[s])
|
||||
fmt.Fprintf(tw, "%s\t%s\n", s, strings.Join(services[s], ","))
|
||||
}
|
||||
if err := tw.Flush(); err != nil {
|
||||
|
|
|
@ -102,7 +102,7 @@ func TestCatalogListServicesCommand_Run(t *testing.T) {
|
|||
}
|
||||
|
||||
output := ui.OutputWriter.String()
|
||||
if expected := "foo,bar"; !strings.Contains(output, expected) {
|
||||
if expected := "bar,foo"; !strings.Contains(output, expected) {
|
||||
t.Errorf("expected %q to contain %q", output, expected)
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue