Modifies TestRemoveDuplicate to remove flake
@@ -9,6 +9,7 @@ import (
"path/filepath"
"reflect"
"regexp"
+ "sort"
"testing"
"github.com/pkg/errors"
@@ -1055,7 +1056,7 @@ func TestRemoveDuplicate(t *testing.T) {
name: "Case 2 - Remove duplicates, none in array",
args: args{
input: []string{"bar", "foo"},
- output: []string{"bar", "foo"},
+ output: []string{"foo", "bar"},
},
},
}
@@ -1065,6 +1066,10 @@ func TestRemoveDuplicate(t *testing.T) {
// Run function RemoveDuplicate
output := RemoveDuplicates(tt.args.input)
+ // sort the strings
+ sort.Strings(output)
+ sort.Strings(tt.args.output)
+
if !(reflect.DeepEqual(output, tt.args.output)) {
t.Errorf("expected %v, got %v", tt.args.output, output)
}
