(t *testing.T)
| 15 | } |
| 16 | |
| 17 | func TestSection(t *testing.T) { |
| 18 | p1 := Point{1, 0} |
| 19 | p2 := Point{5, 0} |
| 20 | wantedPoint := Point{3, 0} |
| 21 | calculatedPoint := Section(&p1, &p2, 1) |
| 22 | if calculatedPoint != wantedPoint { |
| 23 | t.Fatalf("Failed to calculate Section.") |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | func TestSlope(t *testing.T) { |
| 28 | line := Line{P1: Point{1, 2}, P2: Point{2, 4}} |