mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-11 17:45:49 +02:00
Implement a unit test for passing unsupported data types to MurmurHash3_64.update()
This commit brings the coverage of `src/shared/murmurhash3.js` to 100%.
This commit is contained in:
parent
bf924ff31b
commit
f0818c1860
@ -43,6 +43,12 @@ describe("MurmurHash3_64", function () {
|
|||||||
hash.update(new Uint32Array(new Uint8Array(sourceCharCodes).buffer));
|
hash.update(new Uint32Array(new Uint8Array(sourceCharCodes).buffer));
|
||||||
expect(hash.hexdigest()).toEqual(hexDigestExpected);
|
expect(hash.hexdigest()).toEqual(hexDigestExpected);
|
||||||
});
|
});
|
||||||
|
it("throws an exception for unsupported input types", function () {
|
||||||
|
const hash = new MurmurHash3_64();
|
||||||
|
expect(() => hash.update(42)).toThrow(
|
||||||
|
new Error("Invalid data format, must be a string or TypedArray.")
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it("changes the hash after update without seed", function () {
|
it("changes the hash after update without seed", function () {
|
||||||
const hash = new MurmurHash3_64();
|
const hash = new MurmurHash3_64();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user