Permalink
Browse files

Added tests for other methods

  • Loading branch information...
1 parent ace7a91 commit 9c78fae9affa9548b86ea1c15c9701526f6d2f12 @tj tj committed Apr 27, 2012
Showing with 43 additions and 1 deletion.
  1. +43 −1 test/crc.js
View
@@ -6,4 +6,46 @@ describe('crc8()', function(){
it('should work with strings', function(){
crc.crc8('hello world').should.equal(64);
})
-})
+})
+
+describe('crc16()', function(){
+ it('should work with strings', function(){
+ crc.crc16('hello world').should.equal(15332);
+ })
+})
+
+describe('crc32()', function(){
+ it('should work with strings', function(){
+ crc.crc32('hello world').should.equal(222957957);
+ })
+})
+
+describe('crcArc()', function(){
+ it('should work with strings', function(){
+ crc.crcArc('hello world').should.equal(14785);
+ })
+})
+
+describe('fcs16()', function(){
+ it('should work with strings', function(){
+ crc.fcs16('hello world').should.equal(44550);
+ })
+})
+
+describe('hex8()', function(){
+ it('should work with strings', function(){
+ crc.hex8(64).should.equal('40');
+ })
+})
+
+describe('hex16()', function(){
+ it('should work with strings', function(){
+ crc.hex16(15332).should.equal('3BE4');
+ })
+})
+
+describe('hex32()', function(){
+ it('should work with strings', function(){
+ crc.hex32(222957957).should.equal('0D4A1185');
+ })
+})

0 comments on commit 9c78fae

Please sign in to comment.