1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 23:37:43 +00:00

LibJS: Indent tests with 4 spaces instead of 2

This commit is contained in:
Matthew Olsson 2020-07-06 07:37:45 -07:00 committed by Andreas Kling
parent 15de2eda2b
commit 1ef573eb30
261 changed files with 8536 additions and 8497 deletions

View file

@ -1,31 +1,31 @@
const doTest = (operatorName, executeOperation) => {
[1, null, undefined].forEach(value => {
const messageSuffix = operatorName === "unsigned right-shift" ? "" : " and other type";
[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}`
);
});
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],
["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]);
});
test(`using ${testCase[0]} operator with BigInt and other type`, () => {
doTest(testCase[0], testCase[1]);
});
});