>> write path sorter

> correct error in test
> rename to sortedPaths
This commit is contained in:
Thomas Lindop 2025-05-17 16:14:50 +01:00
parent f517f61c55
commit 52c7f8bce6
2 changed files with 24 additions and 3 deletions

View file

@ -71,7 +71,7 @@ func TestRestrictRuneset(t *testing.T) {
}
}
func TestSortPaths(t *testing.T) {
func TestSortedPaths(t *testing.T) {
paths := []string{
"./testdata/Tawnee: The Game",
"./testdata/birds:/pengiuns?",
@ -83,10 +83,10 @@ func TestSortPaths(t *testing.T) {
"./testdata/birds:/pengiuns?/emperor",
"./testdata/birds:/pengiuns?/pingu?",
"./testdata/birds:/pengiuns?",
"./testdata/birds:",
"./testdata/Tawnee: The Game",
"./testdata/birds:",
}
have := sortPaths(paths)
have := sortedPaths(paths)
if len(have) > len(want) {
t.Fatal("Sorted list is bigger than original")
} else if len(have) < len(want) {