diff --git a/spec/test/utilSpec.js b/spec/test/utilSpec.js --- a/spec/test/utilSpec.js +++ b/spec/test/utilSpec.js @@ -14,6 +14,15 @@ describe("Util",function(){ ["\ud84c\udfb4",[0xf0,0xa3,0x8e,0xb4]] ]; + describe("bytes2int32s",function(){ + it("should pack bytes into 32b integers",function(){ + expect(util.bytes2int32s([])).toEqual([]); + expect(util.bytes2int32s([0])).toEqual([0]); + expect(util.bytes2int32s([1])).toEqual([1]); + expect(util.bytes2int32s([0x12,0x34,0x56,0x78,0x9a])).toEqual([0x78563412,0x9a]); + }); + }); + describe("str2utf8",function(){ it("should encode a String into bytes in UTF-8",function(){ utf.forEach(couple=>expect(util.str2utf8(couple[0])).toEqual(couple[1]));