Debian Codegraph @

drawing/curve_test.go

raw symbols SCIP
1 package drawing
2
3 import (
4 "testing"
5
6 "github.com/wcharczuk/go-chart/v2/testutil"
7 )
8
9 type point struct {
10 X, Y float64
11 }
12
13 type mockLine struct {
14 inner []point
15 }
16
17 func (ml *mockLine) LineTo(x, y float64) {
18 ml.inner = append(ml.inner, point{x, y})
19 }
20
21 func (ml mockLine) Len() int {
22 return len(ml.inner)
23 }
24
25 func TestTraceQuad(t *testing.T) {
26 // replaced new assertions helper
27
28 // Quad
29 // x1, y1, cpx1, cpy2, x2, y2 float64
30 // do the 9->12 circle segment
31 quad := []float64{10, 20, 20, 20, 20, 10}
32 liner := &mockLine{}
33 TraceQuad(liner, quad, 0.5)
34 testutil.AssertNotZero(t, liner.Len())
35 }