mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
LibJS: Add BigInt equality tests for some large numbers
This commit is contained in:
parent
1c6fd749dc
commit
4e2a961a3d
1 changed files with 10 additions and 0 deletions
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue