| 1 | package chart |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/wcharczuk/go-chart/v2/testutil" |
| 7 | ) |
| 8 | |
| 9 | func TestLastValueAnnotationSeries(t *testing.T) { |
| 10 | // replaced new assertions helper |
| 11 | |
| 12 | series := ContinuousSeries{ |
| 13 | XValues: []float64{1.0, 2.0, 3.0, 4.0, 5.0}, |
| 14 | YValues: []float64{5.0, 3.0, 3.0, 2.0, 1.0}, |
| 15 | } |
| 16 | |
| 17 | lva := LastValueAnnotationSeries(series) |
| 18 | testutil.AssertNotEmpty(t, lva.Annotations) |
| 19 | lvaa := lva.Annotations[0] |
| 20 | testutil.AssertEqual(t, 5, lvaa.XValue) |
| 21 | testutil.AssertEqual(t, 1, lvaa.YValue) |
| 22 | } |