Add test for ol.structs.RBush#update with single object

This commit is contained in:
Tom Payne
2014-01-06 20:26:40 +01:00
parent ace6c1d098
commit 8a7484c0de

View File

@@ -28,6 +28,24 @@ describe('ol.structs.RBush', function() {
});
describe('with a single object', function() {
var obj;
beforeEach(function() {
obj = {};
rBush.insert([0, 0, 1, 1], obj);
});
it('can update the object', function() {
expect(rBush.getAllInExtent([0, 0, 1, 1])).to.eql([obj]);
rBush.update([2, 2, 3, 3], obj);
expect(rBush.getAllInExtent([0, 0, 1, 1])).to.be.empty();
expect(rBush.getAll()).to.eql([obj]);
expect(rBush.getAllInExtent([2, 2, 3, 3])).to.eql([obj]);
});
});
describe('with a few objects', function() {
var objs;