Add a test for #939

pull/991/head
David Norton 2014-09-22 16:38:51 -04:00 committed by John Shahid
parent a649f6b623
commit e796eea997
1 changed files with 25 additions and 0 deletions

View File

@ -2256,6 +2256,21 @@ var (
"columns": ["time", "value"]
}
]`
aggTstData_Issue939 = `
[
{
"points": [
[300000, 30.0],
[240000, null],
[180000, "foo"],
[120000, 20.0],
[60000, 10.0]
],
"name": "data",
"columns": ["time", "value"]
}
]`
)
// code that's common to many of the folling Test*AggregateFillWith* tests
@ -2348,6 +2363,16 @@ func (self *DataTestSuite) TestMedianAggregateFillWith0(c *C) {
self.tstAggregateFill(aggTstData, "median", "0", emptyAggArgs, aggTstExpect_FillWith0, c)
}
// issue #939 - median panics with null values in column
func (self *DataTestSuite) Test_Issue939_MedianAggregateFillWithNull(c *C) {
self.tstAggregateFill(aggTstData_Issue939, "median", "null", emptyAggArgs, aggTstExpect_FillWithNil, c)
}
// issue #939 - median panics with null values in column
func (self *DataTestSuite) Test_Issue939_MedianAggregateFillWith0(c *C) {
self.tstAggregateFill(aggTstData_Issue939, "median", "0", emptyAggArgs, aggTstExpect_FillWith0, c)
}
// distinct aggregate filling with null
func (self *DataTestSuite) TestDistinctAggregateFillWithNull(c *C) {
self.tstAggregateFill(aggTstData, "distinct", "null", emptyAggArgs, aggTstExpect_FillWithNil, c)