Add Unsorted in the function name

This commit is contained in:
Anant Prakash 2018-07-26 21:54:20 +05:30
parent b19bcd93e5
commit d23dabbc39
No known key found for this signature in database
GPG key ID: C5D399F626523045
2 changed files with 4 additions and 4 deletions

View file

@ -14,9 +14,9 @@ package test
import "sort" import "sort"
// StringSliceEqual returns true if the slices have same length & elements. // UnsortedStringSliceEqual returns true if the slices have same length & elements.
// Does not modify the given slice. // Does not modify the given slice.
func StringSliceEqual(first, second []string) bool { func UnsortedStringSliceEqual(first, second []string) bool {
if len(first) != len(second) { if len(first) != len(second) {
return false return false
} }

View file

@ -116,7 +116,7 @@ func TestGetAuthChainSingle(t *testing.T) {
expectedIDs := []string{"a", "b", "c", "d", "e"} expectedIDs := []string{"a", "b", "c", "d", "e"}
if !test.StringSliceEqual(expectedIDs, returnedIDs) { if !test.UnsortedStringSliceEqual(expectedIDs, returnedIDs) {
t.Fatalf("returnedIDs got '%v', expected '%v'", returnedIDs, expectedIDs) t.Fatalf("returnedIDs got '%v', expected '%v'", returnedIDs, expectedIDs)
} }
} }
@ -149,7 +149,7 @@ func TestGetAuthChainMultiple(t *testing.T) {
expectedIDs := []string{"a", "b", "c", "d", "e", "f"} expectedIDs := []string{"a", "b", "c", "d", "e", "f"}
if !test.StringSliceEqual(expectedIDs, returnedIDs) { if !test.UnsortedStringSliceEqual(expectedIDs, returnedIDs) {
t.Fatalf("returnedIDs got '%v', expected '%v'", returnedIDs, expectedIDs) t.Fatalf("returnedIDs got '%v', expected '%v'", returnedIDs, expectedIDs)
} }
} }