mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-13 11:39:43 +00:00
LibJS: Add BigInt equality tests for some large numbers
This commit is contained in:
parent
1c6fd749dc
commit
4e2a961a3d
Notes:
sideshowbarker
2024-07-18 22:20:08 +09:00
Author: https://github.com/linusg
Commit: 4e2a961a3d
Pull-request: https://github.com/SerenityOS/serenity/pull/5339
Reviewed-by: https://github.com/awesomekling
1 changed files with 10 additions and 0 deletions
|
@ -54,6 +54,11 @@ describe("correct behavior", () => {
|
||||||
expect(1 != 1n).toBeFalse();
|
expect(1 != 1n).toBeFalse();
|
||||||
expect(1n != 1.23).toBeTrue();
|
expect(1n != 1.23).toBeTrue();
|
||||||
expect(1.23 != 1n).toBeTrue();
|
expect(1.23 != 1n).toBeTrue();
|
||||||
|
|
||||||
|
const a = 552141064586571465517761649840658n;
|
||||||
|
const b = 704179908449526267977309288010258n;
|
||||||
|
expect(a == a).toBeTrue();
|
||||||
|
expect(a == b).toBeFalse();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("strong equality operators", () => {
|
test("strong equality operators", () => {
|
||||||
|
@ -68,6 +73,11 @@ describe("correct behavior", () => {
|
||||||
expect(1 !== 1n).toBeTrue();
|
expect(1 !== 1n).toBeTrue();
|
||||||
expect(1n !== 1.23).toBeTrue();
|
expect(1n !== 1.23).toBeTrue();
|
||||||
expect(1.23 !== 1n).toBeTrue();
|
expect(1.23 !== 1n).toBeTrue();
|
||||||
|
|
||||||
|
const a = 552141064586571465517761649840658n;
|
||||||
|
const b = 704179908449526267977309288010258n;
|
||||||
|
expect(a === a).toBeTrue();
|
||||||
|
expect(a === b).toBeFalse();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue