Files
TrafficSpeed/internal/project/points_test.go
Jehiah Czebotar b62fd13263 go modules
2020-04-07 22:00:32 -04:00

25 lines
448 B
Go

package project
import (
"testing"
)
func TestRadians(t *testing.T) {
type testCase struct {
A Point
B Point
Radians float64
}
tests := []testCase{
{Point{10, 10}, Point{20, 11}, -0.0996683256962656},
{Point{10, 10}, Point{20, 9}, 0.0996683256962656},
}
for _, tc := range tests {
got := Radians(tc.A, tc.B)
if got != tc.Radians {
t.Errorf("got %v expected %v for %v %v", got, tc.Radians, tc.A, tc.B)
}
}
}