Document and test ol.getUid sequence behavior
This commit is contained in:
1 parent
617dca34f5
commit
eddfc04ccc
2 files changed
+25
-2
No files matched your search
@@ -0,0 +1,23 @@
|
||||
goog.provide('ol.test');
|
||||
goog.require('ol');
|
||||
|
||||
describe('getUid()', function() {
|
||||
it('is constant once generated', function() {
|
||||
var a = {};
|
||||
expect(ol.getUid(a)).to.be(ol.getUid(a));
|
||||
});
|
||||
|
||||
it('generates a strictly increasing sequence', function() {
|
||||
var a = {} , b = {}, c = {};
|
||||
ol.getUid(a);
|
||||
ol.getUid(c);
|
||||
ol.getUid(b);
|
||||
|
||||
//uid order should be a < c < b
|
||||
expect(ol.getUid(a)).to.be.lessThan(ol.getUid(c));
|
||||
expect(ol.getUid(c)).to.be.lessThan(ol.getUid(b));
|
||||
expect(ol.getUid(a)).to.be.lessThan(ol.getUid(b));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user