LibJS: Add BigInt equality tests for some large numbers

This commit is contained in:
Linus Groh 2021-02-14 10:30:12 +01:00 committed by Andreas Kling
parent 1c6fd749dc
commit 4e2a961a3d

View file

@ -54,6 +54,11 @@ describe("correct behavior", () => {
expect(1 != 1n).toBeFalse();
expect(1n != 1.23).toBeTrue();
expect(1.23 != 1n).toBeTrue();
const a = 552141064586571465517761649840658n;
const b = 704179908449526267977309288010258n;
expect(a == a).toBeTrue();
expect(a == b).toBeFalse();
});
test("strong equality operators", () => {
@ -68,6 +73,11 @@ describe("correct behavior", () => {
expect(1 !== 1n).toBeTrue();
expect(1n !== 1.23).toBeTrue();
expect(1.23 !== 1n).toBeTrue();
const a = 552141064586571465517761649840658n;
const b = 704179908449526267977309288010258n;
expect(a === a).toBeTrue();
expect(a === b).toBeFalse();
});
});