mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-02-26 06:23:13 -06:00
Add Unsorted in the function name
This commit is contained in:
parent
b19bcd93e5
commit
d23dabbc39
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue