Add test case to FileHistoryTest#15528
Merged
Siedlerchr merged 1 commit intoJabRef:mainfrom Apr 11, 2026
Merged
Conversation
Contributor
Review Summary by QodoAdd test for file history size limit enforcement
WalkthroughsDescription• Adds test verifying oldest entry removal when file history exceeds limit • Tests that file history maintains maximum size of 8 entries • Validates that newest file becomes first entry after overflow Diagramflowchart LR
A["Add 8 files to history"] -- "size = 8" --> B["Add 9th file"]
B -- "size stays 8" --> C["Verify oldest file dropped"]
C -- "file9 at index 0" --> D["file1 no longer in history"]
File Changes1. jablib/src/test/java/org/jabref/logic/util/io/FileHistoryTest.java
|
Contributor
Code Review by Qodo
|
|
|
||
| assertEquals(8, history.size()); | ||
| assertEquals(Path.of("file9"), history.get(0)); | ||
| assertFalse(history.contains(Path.of("file1"))); |
Contributor
There was a problem hiding this comment.
1. Weak contains() assertion 📘 Rule violation ≡ Correctness
The new test uses assertFalse(history.contains(...)), which is a weak predicate check and does not assert the exact expected history contents. This can miss regressions where the list content/order is wrong but still does not contain that one element.
Agent Prompt
## Issue description
`oldestEntryIsDroppedWhenSizeExceedsLimit()` uses a weak predicate assertion (`assertFalse(history.contains(...))`) instead of asserting the exact expected contents/order of `history`.
## Issue Context
The project requires tests to assert exact expected values/structures and avoid predicate checks like `contains(...)` that can miss regressions.
## Fix Focus Areas
- jablib/src/test/java/org/jabref/logic/util/io/FileHistoryTest.java[72-84]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Siedlerchr
approved these changes
Apr 11, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issues and pull requests
PR Description
Added test case.
Checklist
CHANGELOG.mdin a way that can be understood by the average user (if change is visible to the user)