2020-07-03 14:39:25 -07:00
|
|
|
test("empty semicolon statements", () => {
|
2020-07-06 07:37:45 -07:00
|
|
|
expect(";;;").toEval();
|
2020-07-03 14:39:25 -07:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test("if with no body", () => {
|
2020-07-06 07:37:45 -07:00
|
|
|
expect("if (true);").toEval();
|
2020-07-03 14:39:25 -07:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test("chained ifs with no bodies", () => {
|
2020-07-06 07:37:45 -07:00
|
|
|
expect("if (false); else if (false); else;").toEval();
|
2020-07-03 14:39:25 -07:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test("while with no body", () => {
|
2020-07-06 07:37:45 -07:00
|
|
|
expect("while (false);").toEval();
|
2020-07-03 14:39:25 -07:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test("do while with no body", () => {
|
2020-07-06 07:37:45 -07:00
|
|
|
expect("do; while (false);").toEval();
|
2020-07-03 14:39:25 -07:00
|
|
|
});
|