Skip to content

Commit

Permalink
Add Unit tests for RefSet.
Browse files Browse the repository at this point in the history
  • Loading branch information
kkujala committed Jan 7, 2012
1 parent d89680b commit f975f92
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/unit/obj_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
});

0 comments on commit f975f92

Please sign in to comment.