mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 23:37:35 +00:00
LibJS: Add some assertions and tests for TypedArray limitations
This commit is contained in:
parent
0e3ee03e2b
commit
7a71d4b887
2 changed files with 21 additions and 0 deletions
|
@ -0,0 +1,18 @@
|
|||
test("some oversized typed arrays", () => {
|
||||
expect(() => new Uint8Array(2 * 1024 * 1024 * 1024)).toThrowWithMessage(
|
||||
RangeError,
|
||||
"Invalid typed array length"
|
||||
);
|
||||
expect(() => new Uint16Array(2 * 1024 * 1024 * 1024)).toThrowWithMessage(
|
||||
RangeError,
|
||||
"Invalid typed array length"
|
||||
);
|
||||
expect(() => new Uint32Array(1024 * 1024 * 1024)).toThrowWithMessage(
|
||||
RangeError,
|
||||
"Invalid typed array length"
|
||||
);
|
||||
expect(() => new Uint32Array(4 * 1024 * 1024 * 1024)).toThrowWithMessage(
|
||||
RangeError,
|
||||
"Invalid typed array length"
|
||||
);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue