mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 07:07:23 +00:00
Libraries: Move to Userland/Libraries/
This commit is contained in:
15
Userland/Libraries/LibJS/Tests/loops/for-basic.js
Normal file
15
Userland/Libraries/LibJS/Tests/loops/for-basic.js
Normal file
@@ -0,0 +1,15 @@
|
||||
test("basic functionality", () => {
|
||||
let a = [];
|
||||
for (let i = 0; i < 3; ++i) {
|
||||
a.push(i);
|
||||
}
|
||||
expect(a).toEqual([0, 1, 2]);
|
||||
});
|
||||
|
||||
test("only condition", () => {
|
||||
let a = [];
|
||||
for (; a.length < 3; ) {
|
||||
a.push("x");
|
||||
}
|
||||
expect(a).toEqual(["x", "x", "x"]);
|
||||
});
|
||||
Reference in New Issue
Block a user