Add ol.structs.IntegerSet.toString

This commit is contained in:
Tom Payne
2013-03-19 07:30:51 +01:00
parent 9047e98889
commit 6ab5cfae8c
2 changed files with 43 additions and 0 deletions

View File

@@ -116,6 +116,14 @@ describe('ol.structs.IntegerSet', function() {
});
describe('toString', function() {
it('returns an empty string', function() {
expect(is.toString()).to.be.empty();
});
});
});
describe('with a populated instance', function() {
@@ -342,6 +350,13 @@ describe('ol.structs.IntegerSet', function() {
});
describe('toString', function() {
it('returns the expected value', function() {
expect(is.toString()).to.be('4-6, 8-10, 12-14');
});
});
});
describe('with fragmentation', function() {
@@ -427,6 +442,14 @@ describe('ol.structs.IntegerSet', function() {
});
describe('toString', function() {
it('returns the expected value', function() {
expect(is.toString()).to.be('0-1, 2-4, 5-8, 9-12, 13-15, 16-17');
});
});
});
describe('compared to a slow reference implementation', function() {