chart test.

This commit is contained in:
Will Charczuk 2017-02-03 11:27:58 -08:00
parent e735797037
commit be0ad5560a

View File

@ -398,3 +398,29 @@ func TestChartRegressionBadRangesByUser(t *testing.T) {
c.Render(PNG, buffer) c.Render(PNG, buffer)
assert.True(true, "Render needs to finish.") assert.True(true, "Render needs to finish.")
} }
func TestChartValidatesSeries(t *testing.T) {
assert := assert.New(t)
c := Chart{
Series: []Series{
ContinuousSeries{
XValues: Sequence.Float64(1.0, 10.0),
YValues: Sequence.Float64(1.0, 10.0),
},
},
}
assert.Nil(c.validateSeries())
c = Chart{
Series: []Series{
ContinuousSeries{
XValues: Sequence.Float64(1.0, 10.0),
},
},
}
assert.NotNil(c.validateSeries())
}