Skip to content

Add UnaryExpr, BinaryExpr, and some record/enum tests to improve overall test coverage#4930

Merged
johannescoetzee merged 2 commits intojavaparser:masterfrom
johannescoetzee:johannes/unary-binary-tests
Dec 18, 2025
Merged

Add UnaryExpr, BinaryExpr, and some record/enum tests to improve overall test coverage#4930
johannescoetzee merged 2 commits intojavaparser:masterfrom
johannescoetzee:johannes/unary-binary-tests

Conversation

@johannescoetzee
Copy link
Copy Markdown
Collaborator

While working on #4929 and the upcoming compact class PR I added the following tests. These are mostly sanity-checks that already passed and aren't strictly related to either of those changes, but are still worth having for the sake of overall test coverage to potentially catch future regressions. I think it makes more sense to add as a separate PR instead of including this in either of the other PRs, distracting from the main purpose of those.

These tests are mostly AI-generated, but I did verify them myself and fixed a few issues manually.

@johannescoetzee johannescoetzee added the PR - TESTCASE Pull requests with this label are test cases only - may later be merged when it passes. label Dec 18, 2025
@johannescoetzee
Copy link
Copy Markdown
Collaborator Author

Check failed due to a connection issue:

Error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (api.github.com:443)

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.460%. Comparing base (0e6f25b) to head (6b8a0ae).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff               @@
##              master     #4930       +/-   ##
===============================================
+ Coverage     58.445%   58.460%   +0.015%     
  Complexity      2560      2560               
===============================================
  Files            689       689               
  Lines          39553     39553               
  Branches        7176      7176               
===============================================
+ Hits           23117     23123        +6     
+ Misses         13497     13491        -6     
  Partials        2939      2939               
Flag Coverage Δ
AlsoSlowTests 58.460% <ø> (+0.015%) ⬆️
javaparser-core 58.460% <ø> (+0.015%) ⬆️
javaparser-symbol-solver 58.460% <ø> (+0.015%) ⬆️
jdk-10 58.027% <ø> (+0.017%) ⬆️
jdk-11 58.026% <ø> (+0.017%) ⬆️
jdk-12 58.023% <ø> (+0.015%) ⬆️
jdk-13 58.026% <ø> (+0.015%) ⬆️
jdk-14 58.261% <ø> (+0.015%) ⬆️
jdk-15 58.261% <ø> (+0.015%) ⬆️
jdk-16 58.236% <ø> (+0.015%) ⬆️
jdk-17 58.387% <ø> (+0.015%) ⬆️
jdk-18 58.387% <ø> (+0.015%) ⬆️
jdk-8 57.867% <ø> (+0.012%) ⬆️
jdk-9 58.022% <ø> (+0.015%) ⬆️
macos-latest 58.453% <ø> (+0.015%) ⬆️
ubuntu-latest 58.448% <ø> (+0.015%) ⬆️
windows-latest 58.443% <ø> (+0.015%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 6 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2186f21...6b8a0ae. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@johannescoetzee johannescoetzee added this to the next release milestone Dec 18, 2025
@johannescoetzee
Copy link
Copy Markdown
Collaborator Author

@jlerbsc what are your thoughts on adding tests like these? Should I just keep adding tests for simple cases like these when there's a gap in our test coverage, even if the tests themselves are very basic?

@jlerbsc
Copy link
Copy Markdown
Collaborator

jlerbsc commented Dec 18, 2025

@jlerbsc what are your thoughts on adding tests like these? Should I just keep adding tests for simple cases like these when there's a gap in our test coverage, even if the tests themselves are very basic?

If you think these tests add value, then you can write them, but don't go overboard, as it can become time-consuming. For me, the most important thing is to fix bugs to make Javaparser more reliable.

@johannescoetzee
Copy link
Copy Markdown
Collaborator Author

@jlerbsc what are your thoughts on adding tests like these? Should I just keep adding tests for simple cases like these when there's a gap in our test coverage, even if the tests themselves are very basic?

If you think these tests add value, then you can write them, but don't go overboard, as it can become time-consuming. For me, the most important thing is to fix bugs to make Javaparser more reliable.

I wouldn't go out of my way to write tests, but I wrote these as part of figuring out what works and what doesn't when investigating the grammar issue

@johannescoetzee johannescoetzee merged commit 0b18881 into javaparser:master Dec 18, 2025
63 of 64 checks passed
@johannescoetzee johannescoetzee deleted the johannes/unary-binary-tests branch December 18, 2025 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR - TESTCASE Pull requests with this label are test cases only - may later be merged when it passes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants