diff --git a/src/ol/structs/integerset.js b/src/ol/structs/integerset.js index 441f37d156..a83850b1ff 100644 --- a/src/ol/structs/integerset.js +++ b/src/ol/structs/integerset.js @@ -26,16 +26,6 @@ ol.structs.IntegerSet = function(opt_arr) { }; -/** - * @param {Array.} arr Array. - * @return {ol.structs.IntegerSet} Integer set. - */ -ol.structs.IntegerSet.unpack = function(arr) { - // FIXME is this needed? - return new ol.structs.IntegerSet(arr); -}; - - /** * @param {number} addStart Start. * @param {number} addStop Stop. diff --git a/test/spec/ol/structs/integerset.test.js b/test/spec/ol/structs/integerset.test.js index 367d33c009..e63c3720be 100644 --- a/test/spec/ol/structs/integerset.test.js +++ b/test/spec/ol/structs/integerset.test.js @@ -15,26 +15,26 @@ describe('ol.structs.IntegerSet', function() { }); - }); + describe('with an argument', function() { - describe('unpack', function() { + it('constructs with a valid array', function() { + var is = new ol.structs.IntegerSet([0, 2, 4, 6]); + expect(is).to.be.an(ol.structs.IntegerSet); + expect(is.getArray()).to.equalArray([0, 2, 4, 6]); + }); - it('constructs with a valid array', function() { - var is = ol.structs.IntegerSet.unpack([0, 2, 4, 6]); - expect(is).to.be.an(ol.structs.IntegerSet); - expect(is.getArray()).to.equalArray([0, 2, 4, 6]); - }); + it('throws an exception with an odd number of elements', function() { + expect(function() { + var is = new ol.structs.IntegerSet([0, 2, 4]); + }).to.throwException(); + }); - it('throws an exception with an odd number of elements', function() { - expect(function() { - var is = ol.structs.IntegerSet.unpack([0, 2, 4]); - }).to.throwException(); - }); + it('throws an exception with out-of-order elements', function() { + expect(function() { + var is = new ol.structs.IntegerSet([0, 2, 2, 4]); + }).to.throwException(); + }); - it('throws an exception with out-of-order elements', function() { - expect(function() { - var is = ol.structs.IntegerSet.unpack([0, 2, 2, 4]); - }).to.throwException(); }); }); @@ -130,7 +130,7 @@ describe('ol.structs.IntegerSet', function() { var is; beforeEach(function() { - is = ol.structs.IntegerSet.unpack([4, 6, 8, 10, 12, 14]); + is = new ol.structs.IntegerSet([4, 6, 8, 10, 12, 14]); }); describe('addRange', function() { @@ -363,8 +363,7 @@ describe('ol.structs.IntegerSet', function() { var is; beforeEach(function() { - is = ol.structs.IntegerSet.unpack( - [0, 1, 2, 4, 5, 8, 9, 12, 13, 15, 16, 17]); + is = new ol.structs.IntegerSet([0, 1, 2, 4, 5, 8, 9, 12, 13, 15, 16, 17]); }); describe('findRange', function() {