1
0
Fork 0
golang-github-wcharczuk-go-.../last_value_annotation_series_test.go
Daniel Baumann 41a2f19f12
Adding upstream version 2.1.2.
Signed-off-by: Daniel Baumann <daniel@debian.org>
2025-05-18 07:17:02 +02:00

22 lines
497 B
Go

package chart
import (
"testing"
"github.com/wcharczuk/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)
}