2 * @fileoverview Tests for the smooth (bezier curve) plotter.
4 * @author danvdk@gmail.com (Dan Vanderkam)
6 describe("smooth-plotter", function() {
8 var getControlPoints
= smoothPlotter
._getControlPoints
;
10 beforeEach(function() {
13 afterEach(function() {
16 it('testNoSmoothing', function() {
17 var lastPt
= {x
: 10, y
: 0},
19 nextPt
= {x
: 12, y
: 0},
22 assert
.deepEqual([11, 1, 11, 1], getControlPoints(lastPt
, pt
, nextPt
, alpha
));
25 it('testHalfSmoothing', function() {
26 var lastPt
= {x
: 10, y
: 0},
28 nextPt
= {x
: 12, y
: 0},
31 assert
.deepEqual([10.5, 1, 11.5, 1], getControlPoints(lastPt
, pt
, nextPt
, alpha
));
34 it('testExtrema', function() {
35 var lastPt
= {x
: 10, y
: 0},
37 nextPt
= {x
: 12, y
: 1},
40 assert
.deepEqual([10.5, 0.75, 11.5, 1.25],
41 getControlPoints(lastPt
, pt
, nextPt
, alpha
, true));
43 assert
.deepEqual([10.5, 1, 11.5, 1],
44 getControlPoints(lastPt
, pt
, nextPt
, alpha
, false));