mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-17 00:23:00 +00:00
Libraries: Move to Userland/Libraries/
This commit is contained in:
parent
dc28c07fa5
commit
13d7c09125
Notes:
sideshowbarker
2024-07-18 23:53:55 +09:00
Author: https://github.com/awesomekling
Commit: 13d7c09125
1857 changed files with 266 additions and 274 deletions
|
@ -1,31 +0,0 @@
|
|||
const doTest = (operatorName, executeOperation) => {
|
||||
[1, null, undefined].forEach(value => {
|
||||
const messageSuffix = operatorName === "unsigned right-shift" ? "" : " and other type";
|
||||
|
||||
expect(() => {
|
||||
executeOperation(1n, value);
|
||||
}).toThrowWithMessage(
|
||||
TypeError,
|
||||
`Cannot use ${operatorName} operator with BigInt${messageSuffix}`
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
[
|
||||
["addition", (a, b) => a + b],
|
||||
["subtraction", (a, b) => a - b],
|
||||
["multiplication", (a, b) => a * b],
|
||||
["division", (a, b) => a / b],
|
||||
["modulo", (a, b) => a % b],
|
||||
["exponentiation", (a, b) => a ** b],
|
||||
["bitwise OR", (a, b) => a | b],
|
||||
["bitwise AND", (a, b) => a & b],
|
||||
["bitwise XOR", (a, b) => a ^ b],
|
||||
["left-shift", (a, b) => a << b],
|
||||
["right-shift", (a, b) => a >> b],
|
||||
["unsigned right-shift", (a, b) => a >>> b],
|
||||
].forEach(testCase => {
|
||||
test(`using ${testCase[0]} operator with BigInt and other type`, () => {
|
||||
doTest(testCase[0], testCase[1]);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue