Add Unit tests for RefSet.

This commit is contained in:
Kalervo Kujala 2012-01-07 22:22:22 +02:00
parent d89680bd94
commit f975f929f5

View File

@ -127,5 +127,23 @@ describe('obj', function() {
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();
});
});
});