(t *testing.T)
| 25 | } |
| 26 | |
| 27 | func TestSlope(t *testing.T) { |
| 28 | line := Line{P1: Point{1, 2}, P2: Point{2, 4}} |
| 29 | var wantedSlope float64 = 2 |
| 30 | var calculatedSlope float64 = Slope(&line) |
| 31 | if calculatedSlope != wantedSlope { |
| 32 | t.Fatalf("Failed to calculate Slope.") |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | func TestIntercept(t *testing.T) { |
| 37 | p := Point{0, 3} |