>> add script for manual testing

> replace path sorter test
> will use this instead of wrriting more tests
This commit is contained in:
Thomas Lindop 2025-05-18 00:19:46 +01:00
parent 52c7f8bce6
commit 923b5aa1a4
2 changed files with 76 additions and 32 deletions

View file

@ -70,35 +70,3 @@ func TestRestrictRuneset(t *testing.T) {
}
}
}
func TestSortedPaths(t *testing.T) {
paths := []string{
"./testdata/Tawnee: The Game",
"./testdata/birds:/pengiuns?",
"./testdata/birds:/pengiuns?/emperor",
"./testdata/birds:/pengiuns?/pingu?",
"./testdata/birds:",
}
want := []string{
"./testdata/birds:/pengiuns?/emperor",
"./testdata/birds:/pengiuns?/pingu?",
"./testdata/birds:/pengiuns?",
"./testdata/Tawnee: The Game",
"./testdata/birds:",
}
have := sortedPaths(paths)
if len(have) > len(want) {
t.Fatal("Sorted list is bigger than original")
} else if len(have) < len(want) {
t.Fatal("Sorted list is smaller than original")
}
for index, path := range have {
if index >= len(want) || path != want[index] {
t.Fatalf(
"Want: %s\nHave: %s\n",
sliceToString(want),
sliceToString(have),
)
}
}
}