Skip to content

Commit

Permalink
Add Math.clz32 test for nonNumbers.
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Dec 1, 2014
1 parent eddad46 commit f5969f5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/math.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ describe('Math', function () {
nonIntegers.forEach(function (item) {
expect(Math.clz32(item)).to.be.within(0, 32);
});
nonNumbers.forEach(function (item) {
expect(Math.clz32(item)).to.equal(item === true ? 31 : 32);
});
expect(Math.clz32(true)).to.equal(Math.clz32(1));
expect(Math.clz32('')).to.equal(Math.clz32(0));
expect(Math.clz32('10')).to.equal(Math.clz32(10));
Expand Down

0 comments on commit f5969f5

Please sign in to comment.