Skip to content

Commit a9372a9

Browse files
committed
delete Buffer unit test
Buffer is a subclass of Uint8Array. also this test probably should have used: import { Buffer } from 'node:buffer';
1 parent cecf8af commit a9372a9

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

packages/math/src/integers.spec.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,6 @@ describe("Integers", () => {
1313
expect(Uint32.fromBytes([0xff, 0xff, 0xff, 0xff]).toNumber()).toEqual(4294967295);
1414
});
1515

16-
it("can be constructed from Buffer", () => {
17-
expect(Uint32.fromBytes(Buffer.from([0, 0, 0, 0])).toNumber()).toEqual(0);
18-
expect(Uint32.fromBytes(Buffer.from([0, 0, 0, 1])).toNumber()).toEqual(1);
19-
expect(Uint32.fromBytes(Buffer.from([0, 0, 0, 42])).toNumber()).toEqual(42);
20-
expect(Uint32.fromBytes(Buffer.from([0x3b, 0x9a, 0xca, 0x00])).toNumber()).toEqual(1000000000);
21-
expect(Uint32.fromBytes(Buffer.from([0x7f, 0xff, 0xff, 0xff])).toNumber()).toEqual(2147483647);
22-
expect(Uint32.fromBytes(Buffer.from([0x80, 0x00, 0x00, 0x00])).toNumber()).toEqual(2147483648);
23-
expect(Uint32.fromBytes(Buffer.from([0xff, 0xff, 0xff, 0xff])).toNumber()).toEqual(4294967295);
24-
});
25-
2616
it("throws for invalid input length", () => {
2717
expect(() => Uint32.fromBytes([])).toThrowError(/Invalid input length/);
2818
expect(() => Uint32.fromBytes([0, 0, 0])).toThrowError(/Invalid input length/);

0 commit comments

Comments
 (0)