-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Refactor NoBibTexFieldCheckerTest to increase mutation coverage #7697
Conversation
…rage 1. Switched to using parametrized test 2. Covers missing conditions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first, it looks good. Some minor remark remaining
Arguments.of(new UnknownField("fieldNameNotDefinedInThebiblatexManual"), Collections.emptyList()), | ||
|
||
// these fields are displayed by JabRef as default | ||
Arguments.of(StandardField.ABSTRACT, Collections.emptyList()), | ||
Arguments.of(StandardField.COMMENT, Collections.emptyList()), | ||
Arguments.of(StandardField.DOI, Collections.emptyList()), | ||
Arguments.of(StandardField.URL, Collections.emptyList()), | ||
|
||
// these fields are not recognized as biblatex only fields | ||
Arguments.of(StandardField.ADDRESS, Collections.emptyList()), | ||
Arguments.of(StandardField.INSTITUTION, Collections.emptyList()), | ||
Arguments.of(StandardField.JOURNAL, Collections.emptyList()), | ||
Arguments.of(StandardField.KEYWORDS, Collections.emptyList()), | ||
Arguments.of(StandardField.REVIEW, Collections.emptyList()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each thing gets , Collections.emptyList()
as paramter. Thus, this can be removed.
Maybe, even Stream.of(List.of(StandardField.ABSTRACT, StandardField.COMMENT, ...)
can be used.
Arguments.of(new UnknownField("fieldNameNotDefinedInThebiblatexManual"), Collections.emptyList()), | |
// these fields are displayed by JabRef as default | |
Arguments.of(StandardField.ABSTRACT, Collections.emptyList()), | |
Arguments.of(StandardField.COMMENT, Collections.emptyList()), | |
Arguments.of(StandardField.DOI, Collections.emptyList()), | |
Arguments.of(StandardField.URL, Collections.emptyList()), | |
// these fields are not recognized as biblatex only fields | |
Arguments.of(StandardField.ADDRESS, Collections.emptyList()), | |
Arguments.of(StandardField.INSTITUTION, Collections.emptyList()), | |
Arguments.of(StandardField.JOURNAL, Collections.emptyList()), | |
Arguments.of(StandardField.KEYWORDS, Collections.emptyList()), | |
Arguments.of(StandardField.REVIEW, Collections.emptyList()) | |
Arguments.of(new UnknownField("fieldNameNotDefinedInThebiblatexManual")), | |
// these fields are displayed by JabRef as default | |
Arguments.of(StandardField.ABSTRACT), | |
Arguments.of(StandardField.COMMENT), | |
Arguments.of(StandardField.DOI), | |
Arguments.of(StandardField.URL), | |
// these fields are not recognized as biblatex only fields | |
Arguments.of(StandardField.ADDRESS), | |
Arguments.of(StandardField.INSTITUTION), | |
Arguments.of(StandardField.JOURNAL), | |
Arguments.of(StandardField.KEYWORDS), | |
Arguments.of(StandardField.REVIEW) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is updated as suggested. :)
* upstream/main: (354 commits) Fix ScienceDirect fetcher (#7684) Refactor NoBibTexFieldCheckerTest to increase mutation coverage (#7697) Update Gradle from 6.8.3 to 7.0 (#7619) Fixes #7305: the RFC fetcher is not compatible with the draftFix for issue 7305 (#7674) Refactoring existing unit tests (#7693) cover boundary cases & add more unit tests (#7694) Bump classgraph from 4.8.104 to 4.8.105 (#7688) Bump java-diff-utils from 4.9 to 4.10 (#7692) Fix arXiv fetcher tests (#7686) Make key for ScienceDirect configurable (#7683) migration of timestamp (#7671) Fix CCSB and DOAJ (#7426) [Bot] Update CSL styles (#7680) MS Office XML: Export month name (#7677) linkfix (#7678) readd fix (#7675) Fix threading cleanup in performSearch (#7672) add missing changelog delete bug fix (#7580) Add more unit tests to three gui classes (#7636) ... # Conflicts: # build.gradle
This pull request contributes to issue #6207, which is to add more unit tests or improve existing ones. I used Pitest to compute the mutation coverage and found that some conditions were not covered in the unit test and some conditions tested were redundant because they would not be reached. Following are the changes:
Before:
After:
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)