Skip to content

Commit f161415

Browse files
committed
Add a test that a degenerate domain does not cause histogram to barf.
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
1 parent bf151c2 commit f161415

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

test/layout/histogram-test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ suite.addBatch({
6868
{x: 1, y: 1, dx: 1},
6969
{x: 2, y: 2, dx: 1}
7070
]);
71+
},
72+
"can handle degenerate domain": function(histogram) {
73+
var h = histogram().bins(d3.scale.linear().domain([0,0]).ticks(3));
74+
assert.deepEqual(h([0]), []);
7175
}
7276
}
7377
});

0 commit comments

Comments
 (0)