summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Tests/builtins
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-01-07 08:51:52 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-07 08:57:37 +0100
commit7ed89703fea8fcd2ca7da6fa50c78ff9d84b1113 (patch)
tree20f9057c7fe0c94fe472f9fbd1dfb766ea645d3e /Libraries/LibJS/Tests/builtins
parentcd2f85dc108e421e409538118751b8ac14b47a13 (diff)
downloadserenity-7ed89703fea8fcd2ca7da6fa50c78ff9d84b1113.zip
LibCrypto+LibJS: Fix broken subtraction of two negative signed bigints
Found by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=29326
Diffstat (limited to 'Libraries/LibJS/Tests/builtins')
-rw-r--r--Libraries/LibJS/Tests/builtins/BigInt/bigint-minus.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/Libraries/LibJS/Tests/builtins/BigInt/bigint-minus.js b/Libraries/LibJS/Tests/builtins/BigInt/bigint-minus.js
new file mode 100644
index 0000000000..5d88f85ce2
--- /dev/null
+++ b/Libraries/LibJS/Tests/builtins/BigInt/bigint-minus.js
@@ -0,0 +1,8 @@
+describe("minus behavior", () => {
+ test("the basics", () => {
+ expect(3n - 4n).toBe(-1n);
+ expect(3n - -4n).toBe(7n);
+ expect(-3n - -4n).toBe(-1n);
+ expect(-3n - 4n).toBe(-7n);
+ });
+});