Add break tests
This commit is contained in:
parent
4172071dba
commit
9af941bc2e
@ -47,5 +47,17 @@ int main() {
|
||||
true
|
||||
);
|
||||
|
||||
_TEST_ASSERT(
|
||||
_TEST_NO_EXCEPTION(get<int>(execute("int x; for (int i=0; i < 30; i++) { x=i; if (i==20) break; }; x;")) == 20),
|
||||
"For break",
|
||||
true
|
||||
);
|
||||
|
||||
_TEST_ASSERT(
|
||||
_TEST_NO_EXCEPTION(get<int>(execute("int x; int i=0; while (i < 30) { x=i; if (i==20) break; i++; }; x;")) == 20),
|
||||
"While break",
|
||||
true
|
||||
);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user