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

Replace some colossal strings in the compiler tests #3581

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

datho7561
Copy link
Contributor

@datho7561 datho7561 commented Jan 20, 2025

There are some very large string literals in the compiler tests. These string literals make the code hard to read, since you have to scroll down thousands of lines to see the rest of the test case. Since these strings are very repetitive, they can be easily generated with a StringBuilder and for loops.

After this change, we will still be testing that ECJ can compile colossal strings, since there is a test case for that.

What it does

Replace some colossal string literals in the compiler tests with strings built using StringBuilder and for loops.

How to test

Run the compiler test suite. The tests should compile, run, and pass.

Author checklist

@rgrunber rgrunber self-requested a review January 20, 2025 14:31
@datho7561 datho7561 force-pushed the remove-colossal-strings branch from 583ba8a to 9fc5ce0 Compare January 20, 2025 14:31
@rgrunber rgrunber added this to the 4.35 M2 milestone Jan 20, 2025
@datho7561 datho7561 force-pushed the remove-colossal-strings branch 2 times, most recently from 486364e to 543d3ea Compare January 20, 2025 16:41
@datho7561
Copy link
Contributor Author

datho7561 commented Jan 20, 2025

One of the test cases had imbalanced brackets; I think I've fixed it now but I want to see the test results first but I'll wait for CI before marking this as ready for review.

update: okay it seems to be passing now

@datho7561 datho7561 marked this pull request as ready for review January 20, 2025 18:25
There are some very large string literals in the compiler tests.
These string literals make the code hard to read,
since you have to scroll down thousands of lines to see the rest of the test case.
Since these strings are very repetitive,
they can be easily generated with a `StringBuilder` and for loops.

After this change,
we will still be testing that ECJ can compile colossal strings,
since there is a test case for that.

Signed-off-by: David Thompson <[email protected]>
@datho7561 datho7561 force-pushed the remove-colossal-strings branch from 543d3ea to 938ea1e Compare January 20, 2025 18:25
Copy link
Contributor

@rgrunber rgrunber left a comment

Choose a reason for hiding this comment

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

Overall looks good. There's nothing that explicitly states the file being maintained must also be "very large", so as long as the testcase is still testing a large source file, it should be fine.

Just wondering why you left out some cases of test00NM in XLargeTest. Not that halving the size of the source file isn't great (but ~12k is still a large file).

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