Transformed
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
|
||||
|
||||
goog.require('ol.structs.LinkedList');
|
||||
import _ol_structs_LinkedList_ from '../../../../src/ol/structs/LinkedList.js';
|
||||
|
||||
describe('ol.structs.LinkedList', function() {
|
||||
var ll;
|
||||
var item = {};
|
||||
var item2 = {};
|
||||
beforeEach(function() {
|
||||
ll = new ol.structs.LinkedList();
|
||||
ll = new _ol_structs_LinkedList_();
|
||||
});
|
||||
|
||||
it('defaults to circular', function() {
|
||||
@@ -61,7 +59,7 @@ describe('ol.structs.LinkedList', function() {
|
||||
});
|
||||
|
||||
it('otherwise sets the cursor to the prevous item', function() {
|
||||
ll = new ol.structs.LinkedList(false);
|
||||
ll = new _ol_structs_LinkedList_(false);
|
||||
ll.insertItem(item);
|
||||
ll.insertItem(item2);
|
||||
ll.insertItem(item3);
|
||||
@@ -70,7 +68,7 @@ describe('ol.structs.LinkedList', function() {
|
||||
});
|
||||
|
||||
it('empties a list with only one item', function() {
|
||||
ll = new ol.structs.LinkedList();
|
||||
ll = new _ol_structs_LinkedList_();
|
||||
ll.insertItem(item);
|
||||
ll.removeItem();
|
||||
expect(ll.length_).to.be(0);
|
||||
@@ -204,7 +202,7 @@ describe('ol.structs.LinkedList', function() {
|
||||
var ll2, item3;
|
||||
beforeEach(function() {
|
||||
item3 = {};
|
||||
ll2 = new ol.structs.LinkedList();
|
||||
ll2 = new _ol_structs_LinkedList_();
|
||||
ll2.insertItem(item);
|
||||
ll2.insertItem(item2);
|
||||
ll2.insertItem(item3);
|
||||
@@ -244,7 +242,7 @@ describe('ol.structs.LinkedList', function() {
|
||||
|
||||
describe('when circular', function() {
|
||||
beforeEach(function() {
|
||||
ll = new ol.structs.LinkedList();
|
||||
ll = new _ol_structs_LinkedList_();
|
||||
ll.insertItem(item);
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
|
||||
|
||||
goog.require('ol.structs.LRUCache');
|
||||
import _ol_structs_LRUCache_ from '../../../../src/ol/structs/LRUCache.js';
|
||||
|
||||
|
||||
describe('ol.structs.LRUCache', function() {
|
||||
@@ -15,7 +13,7 @@ describe('ol.structs.LRUCache', function() {
|
||||
}
|
||||
|
||||
beforeEach(function() {
|
||||
lruCache = new ol.structs.LRUCache();
|
||||
lruCache = new _ol_structs_LRUCache_();
|
||||
});
|
||||
|
||||
describe('empty cache', function() {
|
||||
@@ -166,7 +164,7 @@ describe('ol.structs.LRUCache', function() {
|
||||
|
||||
describe('#peekFirstKey()', function() {
|
||||
it('returns the newest key in the cache', function() {
|
||||
var cache = new ol.structs.LRUCache();
|
||||
var cache = new _ol_structs_LRUCache_();
|
||||
cache.set('oldest', 'oldest');
|
||||
cache.set('oldish', 'oldish');
|
||||
cache.set('newish', 'newish');
|
||||
@@ -175,13 +173,13 @@ describe('ol.structs.LRUCache', function() {
|
||||
});
|
||||
|
||||
it('works if the cache has one item', function() {
|
||||
var cache = new ol.structs.LRUCache();
|
||||
var cache = new _ol_structs_LRUCache_();
|
||||
cache.set('key', 'value');
|
||||
expect(cache.peekFirstKey()).to.eql('key');
|
||||
});
|
||||
|
||||
it('throws if the cache is empty', function() {
|
||||
var cache = new ol.structs.LRUCache();
|
||||
var cache = new _ol_structs_LRUCache_();
|
||||
expect(function() {
|
||||
cache.peekFirstKey();
|
||||
}).to.throwException();
|
||||
@@ -214,7 +212,7 @@ describe('ol.structs.LRUCache', function() {
|
||||
|
||||
describe('#remove()', function() {
|
||||
it('removes an item from the cache', function() {
|
||||
var cache = new ol.structs.LRUCache();
|
||||
var cache = new _ol_structs_LRUCache_();
|
||||
cache.set('oldest', 'oldest');
|
||||
cache.set('oldish', 'oldish');
|
||||
cache.set('newish', 'newish');
|
||||
@@ -226,7 +224,7 @@ describe('ol.structs.LRUCache', function() {
|
||||
});
|
||||
|
||||
it('works when removing the oldest item', function() {
|
||||
var cache = new ol.structs.LRUCache();
|
||||
var cache = new _ol_structs_LRUCache_();
|
||||
cache.set('oldest', 'oldest');
|
||||
cache.set('oldish', 'oldish');
|
||||
cache.set('newish', 'newish');
|
||||
@@ -239,7 +237,7 @@ describe('ol.structs.LRUCache', function() {
|
||||
});
|
||||
|
||||
it('works when removing the newest item', function() {
|
||||
var cache = new ol.structs.LRUCache();
|
||||
var cache = new _ol_structs_LRUCache_();
|
||||
cache.set('oldest', 'oldest');
|
||||
cache.set('oldish', 'oldish');
|
||||
cache.set('newish', 'newish');
|
||||
@@ -252,7 +250,7 @@ describe('ol.structs.LRUCache', function() {
|
||||
});
|
||||
|
||||
it('returns the removed item', function() {
|
||||
var cache = new ol.structs.LRUCache();
|
||||
var cache = new _ol_structs_LRUCache_();
|
||||
var item = {};
|
||||
cache.set('key', item);
|
||||
|
||||
@@ -261,7 +259,7 @@ describe('ol.structs.LRUCache', function() {
|
||||
});
|
||||
|
||||
it('throws if the key does not exist', function() {
|
||||
var cache = new ol.structs.LRUCache();
|
||||
var cache = new _ol_structs_LRUCache_();
|
||||
cache.set('foo', 'foo');
|
||||
cache.set('bar', 'bar');
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
|
||||
|
||||
goog.require('ol.structs.PriorityQueue');
|
||||
import _ol_structs_PriorityQueue_ from '../../../../src/ol/structs/PriorityQueue.js';
|
||||
|
||||
|
||||
describe('ol.structs.PriorityQueue', function() {
|
||||
@@ -13,7 +11,7 @@ describe('ol.structs.PriorityQueue', function() {
|
||||
|
||||
var pq;
|
||||
beforeEach(function() {
|
||||
pq = new ol.structs.PriorityQueue(identity, identity);
|
||||
pq = new _ol_structs_PriorityQueue_(identity, identity);
|
||||
});
|
||||
|
||||
it('is empty', function() {
|
||||
@@ -41,7 +39,7 @@ describe('ol.structs.PriorityQueue', function() {
|
||||
var elements, pq;
|
||||
beforeEach(function() {
|
||||
elements = [];
|
||||
pq = new ol.structs.PriorityQueue(
|
||||
pq = new _ol_structs_PriorityQueue_(
|
||||
identity, identity);
|
||||
var element, i;
|
||||
for (i = 0; i < 32; ++i) {
|
||||
@@ -67,7 +65,7 @@ describe('ol.structs.PriorityQueue', function() {
|
||||
var pq, target;
|
||||
beforeEach(function() {
|
||||
target = 0.5;
|
||||
pq = new ol.structs.PriorityQueue(function(element) {
|
||||
pq = new _ol_structs_PriorityQueue_(function(element) {
|
||||
return Math.abs(element - target);
|
||||
}, identity);
|
||||
var i;
|
||||
@@ -105,7 +103,7 @@ describe('ol.structs.PriorityQueue', function() {
|
||||
if (i++ % 2 === 0) {
|
||||
return Math.abs(element - target);
|
||||
} else {
|
||||
return ol.structs.PriorityQueue.DROP;
|
||||
return _ol_structs_PriorityQueue_.DROP;
|
||||
}
|
||||
};
|
||||
pq.reprioritize();
|
||||
@@ -125,7 +123,7 @@ describe('ol.structs.PriorityQueue', function() {
|
||||
|
||||
var pq;
|
||||
beforeEach(function() {
|
||||
pq = new ol.structs.PriorityQueue(
|
||||
pq = new _ol_structs_PriorityQueue_(
|
||||
identity, identity);
|
||||
pq.enqueue('a');
|
||||
pq.enqueue('b');
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
|
||||
|
||||
goog.require('ol.structs.RBush');
|
||||
import _ol_structs_RBush_ from '../../../../src/ol/structs/RBush.js';
|
||||
|
||||
|
||||
describe('ol.structs.RBush', function() {
|
||||
|
||||
var rBush;
|
||||
beforeEach(function() {
|
||||
rBush = new ol.structs.RBush();
|
||||
rBush = new _ol_structs_RBush_();
|
||||
});
|
||||
|
||||
describe('when empty', function() {
|
||||
@@ -318,7 +316,7 @@ describe('ol.structs.RBush', function() {
|
||||
it('concatenates two RBush objects', function() {
|
||||
var obj1 = {};
|
||||
var obj2 = {};
|
||||
var rBush2 = new ol.structs.RBush();
|
||||
var rBush2 = new _ol_structs_RBush_();
|
||||
rBush.insert([0, 0, 1, 1], obj1);
|
||||
rBush2.insert([0, 0, 2, 2], obj2);
|
||||
rBush.concat(rBush2);
|
||||
@@ -329,7 +327,7 @@ describe('ol.structs.RBush', function() {
|
||||
it('preserves the concatenated object\'s references', function() {
|
||||
var obj1 = {};
|
||||
var obj2 = {};
|
||||
var rBush2 = new ol.structs.RBush();
|
||||
var rBush2 = new _ol_structs_RBush_();
|
||||
rBush.insert([0, 0, 1, 1], obj1);
|
||||
rBush2.insert([0, 0, 2, 2], obj2);
|
||||
rBush.concat(rBush2);
|
||||
|
||||
Reference in New Issue
Block a user