1package drawing
2
3import (
4	"testing"
5
6	assert "github.com/blend/go-sdk/assert"
7)
8
9type point struct {
10	X, Y float64
11}
12
13type mockLine struct {
14	inner []point
15}
16
17func (ml *mockLine) LineTo(x, y float64) {
18	ml.inner = append(ml.inner, point{x, y})
19}
20
21func (ml mockLine) Len() int {
22	return len(ml.inner)
23}
24
25func TestTraceQuad(t *testing.T) {
26	assert := assert.New(t)
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	assert.NotZero(liner.Len())
35}
36