mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-18 00:02:01 +00:00
Libraries: Move to Userland/Libraries/
This commit is contained in:
parent
dc28c07fa5
commit
13d7c09125
Notes:
sideshowbarker
2024-07-18 23:53:55 +09:00
Author: https://github.com/awesomekling
Commit: 13d7c09125
1857 changed files with 266 additions and 274 deletions
|
@ -1,53 +0,0 @@
|
|||
describe("correct behavior", () => {
|
||||
test("basic functionality", () => {
|
||||
let n = 0;
|
||||
expect(++n).toBe(1);
|
||||
expect(n).toBe(1);
|
||||
|
||||
n = 0;
|
||||
expect(n++).toBe(0);
|
||||
expect(n).toBe(1);
|
||||
|
||||
n = 0;
|
||||
expect(--n).toBe(-1);
|
||||
expect(n).toBe(-1);
|
||||
|
||||
n = 0;
|
||||
expect(n--).toBe(0);
|
||||
expect(n).toBe(-1);
|
||||
|
||||
let a = [];
|
||||
expect(a++).toBe(0);
|
||||
expect(a).toBe(1);
|
||||
|
||||
let b = true;
|
||||
expect(b--).toBe(1);
|
||||
expect(b).toBe(0);
|
||||
});
|
||||
|
||||
test("updates that produce NaN", () => {
|
||||
let s = "foo";
|
||||
expect(++s).toBeNaN();
|
||||
expect(s).toBeNaN();
|
||||
|
||||
s = "foo";
|
||||
expect(s++).toBeNaN();
|
||||
expect(s).toBeNaN();
|
||||
|
||||
s = "foo";
|
||||
expect(--s).toBeNaN();
|
||||
expect(s).toBeNaN();
|
||||
|
||||
s = "foo";
|
||||
expect(s--).toBeNaN();
|
||||
expect(s).toBeNaN();
|
||||
});
|
||||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("update expression throws reference error", () => {
|
||||
expect(() => {
|
||||
++x;
|
||||
}).toThrowWithMessage(ReferenceError, "'x' is not defined");
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue