Merge pull request #1040 from kkujala/refactor
Add Unit tests for RefSet.
This commit is contained in:
commit
f8f17231e6
@ -118,7 +118,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||||||
var self = this;
|
var self = this;
|
||||||
var xref = this.xref;
|
var xref = this.xref;
|
||||||
var handler = this.handler;
|
var handler = this.handler;
|
||||||
var uniquePrefix = this.uniquePrefix;
|
var uniquePrefix = this.uniquePrefix || '';
|
||||||
|
|
||||||
function insertDependency(depList) {
|
function insertDependency(depList) {
|
||||||
fnArray.push('dependency');
|
fnArray.push('dependency');
|
||||||
@ -235,7 +235,6 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||||||
}, handler, xref, resources, image, inline);
|
}, handler, xref, resources, image, inline);
|
||||||
}
|
}
|
||||||
|
|
||||||
uniquePrefix = uniquePrefix || '';
|
|
||||||
if (!queue.argsArray) {
|
if (!queue.argsArray) {
|
||||||
queue.argsArray = [];
|
queue.argsArray = [];
|
||||||
}
|
}
|
||||||
|
@ -127,5 +127,23 @@ describe('obj', function() {
|
|||||||
expect(ref.gen).toEqual(storedGen);
|
expect(ref.gen).toEqual(storedGen);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('RefSet', function() {
|
||||||
|
it('should have a stored value', function() {
|
||||||
|
var ref = new Ref(4, 2);
|
||||||
|
var refset = new RefSet();
|
||||||
|
refset.put(ref);
|
||||||
|
expect(refset.has(ref)).toBeTruthy();
|
||||||
|
});
|
||||||
|
it('should not have an unknown value', function() {
|
||||||
|
var ref = new Ref(4, 2);
|
||||||
|
var refset = new RefSet();
|
||||||
|
expect(refset.has(ref)).toBeFalsy();
|
||||||
|
|
||||||
|
refset.put(ref);
|
||||||
|
var anotherRef = new Ref(2, 4);
|
||||||
|
expect(refset.has(anotherRef)).toBeFalsy();
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user