Skip to content

Commit

Permalink
Add a test that goto statements are not parsed as variable declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
kiokuless committed Jul 18, 2023
1 parent d350ff9 commit 566090f
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions tests/test_run.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# ############################################################################ #
# **************************************************************************** #
# #
# ::: :::::::: #
# test_run.py :+: :+: :+: #
# +:+ +:+ +:+ #
# By: charles <me@cacharle.xyz> +#+ +:+ +#+ #
# By: kiokuless <me[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/02/08 19:56:48 by charles #+# #+# #
# Updated: 2021/02/11 20:27:07 by charles ### ########.fr #
# Updated: 2023/07/18 23:42:04 by kiokuless ### ########.fr #
# #
# ############################################################################ #
# **************************************************************************** #

import pytest

Expand Down Expand Up @@ -82,3 +82,29 @@ def test_basic():
}
"""
assert output == run_all(input)

def test_goto_statement():
input = """
int main(void)
{
int i;
int i = 0;
while(i < 10)
i++;
goto ok;
return (0);
}
"""
output = """
int\tmain(void)
{
int i;
i = 0;
while (i < 10)
i++;
goto ok;
return (0);
}
"""
assert output == run_all(input)

0 comments on commit 566090f

Please sign in to comment.