Commit 5b927c95 authored by Daniel Sonck's avatar Daniel Sonck
Browse files

Also test reverse distance and 0 distance

parent e8cec161
......@@ -40,6 +40,20 @@ func TestListItem_Distance(t *testing.T) {
if answer != count-1 {
t.Fatalf("Start().Distance() failed, expected %v, got %v", count-1, answer)
}
answer, err = playlist.End().Distance(playlist.Start())
if err != nil {
t.Fatalf("Start().Distance() errored, did not expect an error, %v", err.Error())
}
if answer != count-1 {
t.Fatalf("Start().Distance() failed, expected %v, got %v", count-1, answer)
}
answer, err = playlist.Start().Distance(playlist.Start())
if err != nil {
t.Fatalf("Start().Distance() errored, did not expect an error, %v", err.Error())
}
if answer != 0 {
t.Fatalf("Start().Distance() failed, expected %v, got %v", 0, answer)
}
}
func TestListItem_Distance_Unrelated(t *testing.T) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment