| 1 | package chart |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/wcharczuk/go-chart/v2/testutil" |
| 7 | ) |
| 8 | |
| 9 | func TestGenerateGridLines(t *testing.T) { |
| 10 | // replaced new assertions helper |
| 11 | |
| 12 | ticks := []Tick{ |
| 13 | {Value: 1.0, Label: "1.0"}, |
| 14 | {Value: 2.0, Label: "2.0"}, |
| 15 | {Value: 3.0, Label: "3.0"}, |
| 16 | {Value: 4.0, Label: "4.0"}, |
| 17 | } |
| 18 | |
| 19 | gl := GenerateGridLines(ticks, Style{}, Style{}) |
| 20 | testutil.AssertLen(t, gl, 2) |
| 21 | |
| 22 | testutil.AssertEqual(t, 2.0, gl[0].Value) |
| 23 | testutil.AssertEqual(t, 3.0, gl[1].Value) |
| 24 | } |