-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test that goto statements are not parsed as variable declarations
- Loading branch information
Showing
1 changed file
with
30 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
@@ -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) |