>> add script for manual testing
> replace path sorter test > will use this instead of wrriting more tests
This commit is contained in:
parent
52c7f8bce6
commit
923b5aa1a4
2 changed files with 76 additions and 32 deletions
32
owl_test.go
32
owl_test.go
|
|
@ -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),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue