Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Incorrect model for empty for loop #3108

Merged
merged 3 commits into from
Sep 19, 2019
Merged

Conversation

Egor18
Copy link
Contributor

@Egor18 Egor18 commented Sep 18, 2019

Hi! I found out that Spoon generates incorrect model for the following code:

for (;;)
    x = 5;

But the model is:
for (; x = 5; );

This PR provides corresponding test and possible fix.

assertTrue(ctFor.getForInit().isEmpty());
assertNull(ctFor.getExpression());
assertTrue(ctFor.getForUpdate().isEmpty());
assertNotNull(ctFor.getBody());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assertEquals on the body instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@monperrus monperrus merged commit eddd948 into INRIA:master Sep 19, 2019
@monperrus
Copy link
Collaborator

Thanks a lot!

@monperrus monperrus mentioned this pull request Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants