diff --git a/test/statements.cpp b/test/statements.cpp index af9980c..2b1d650 100644 --- a/test/statements.cpp +++ b/test/statements.cpp @@ -47,5 +47,17 @@ int main() { true ); + _TEST_ASSERT( + _TEST_NO_EXCEPTION(get(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(execute("int x; int i=0; while (i < 30) { x=i; if (i==20) break; i++; }; x;")) == 20), + "While break", + true + ); + return 0; } \ No newline at end of file