go-chart/last_value_annotation_series_test.go
Zeni Kim cc8d36edd9
Some checks failed
Continuous Integration / Tests (push) Has been cancelled
update url
2024-10-27 21:52:38 -05:00

22 lines
501 B
Go

package chart
import (
"testing"
"git.smarteching.com/zeni/go-chart/v2/testutil"
)
func TestLastValueAnnotationSeries(t *testing.T) {
// replaced new assertions helper
series := ContinuousSeries{
XValues: []float64{1.0, 2.0, 3.0, 4.0, 5.0},
YValues: []float64{5.0, 3.0, 3.0, 2.0, 1.0},
}
lva := LastValueAnnotationSeries(series)
testutil.AssertNotEmpty(t, lva.Annotations)
lvaa := lva.Annotations[0]
testutil.AssertEqual(t, 5, lvaa.XValue)
testutil.AssertEqual(t, 1, lvaa.YValue)
}