Everywhere: Hoist the Libraries folder to the top-level

This commit is contained in:
Timothy Flynn 2024-11-09 12:25:08 -05:00 committed by Andreas Kling
commit 93712b24bf
Notes: github-actions[bot] 2024-11-10 11:51:52 +00:00
4547 changed files with 104 additions and 113 deletions

View file

@ -0,0 +1,69 @@
describe("switch statement is a valid statement and gets executed", () => {
test("switch statement in a block", () => {
let hit = false;
{
switch (true) {
case true:
hit = true;
}
expect(hit).toBeTrue();
}
});
test("switch statement in an if statement when true", () => {
let hit = false;
var a = true;
if (a)
switch (true) {
case true:
hit = true;
}
else
switch (true) {
case true:
expect().fail();
}
expect(hit).toBeTrue();
});
test("switch statement in an if statement when false", () => {
let hit = false;
var a = false;
if (a)
switch (a) {
default:
expect().fail();
}
else
switch (a) {
default:
hit = true;
}
expect(hit).toBeTrue();
});
test("switch statement in an while statement", () => {
var a = 0;
var loops = 0;
while (a < 1 && loops++ < 5)
switch (a) {
case 0:
a = 1;
}
expect(a).toBe(1);
});
test("switch statement in an for statement", () => {
var loops = 0;
for (let a = 0; a < 1 && loops++ < 5; )
switch (a) {
case 0:
a = 1;
}
expect(loops).toBe(1);
});
});