Skip to content

Conversation

@EricW123
Copy link

@EricW123 EricW123 commented Nov 8, 2025

Refs #676

This PR refactors RemoveHyphenatedNewlinesFormatterTest, TrimWhitespaceFormatterTest, UnicodeConverterTest and UnitsToLatexFormatterTest to use parameterized tests (@CsvSource and @valuesource) following the one-assertion-per-test guideline.

Note: My classmates are also contributing to this issue.

@espertusnu

How to test:

./gradlew :jablib:test \
    --tests org.jabref.logic.formatter.bibtexfields.TrimWhitespaceFormatterTest \
    --tests org.jabref.logic.formatter.bibtexfields.UnicodeConverterTest \
    --tests org.jabref.logic.formatter.bibtexfields.UnitsToLatexFormatterTest \
    --tests org.jabref.logic.formatter.bibtexfields.RemoveHyphenatedNewlinesFormatterTest

Copy link
Member

@koppor koppor left a comment

Choose a reason for hiding this comment

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

Plesae use text blocks

Comment on lines +29 to +35
// combining accents
"{\\\"{a}}, a\u0308",
"{\\\"{a}}b, a\u0308b",

// plain unicode letters
"{\\\"{a}}, ä",
"{{$\\Epsilon$}}, \u0395"
Copy link
Member

Choose a reason for hiding this comment

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

Please use text blocks here. See https://devdocs.jabref.org/code-howtos/testing.html#use-paramterizedtests for an example, Youc an use , as delimiter.

assertEquals("1~{A}", formatter.format("1 A"));
assertEquals("1\\mbox{-}{mA}", formatter.format("1-mA"));
@ParameterizedTest
@CsvSource({"1~{A}, 1 A", "1\\mbox{-}{mA}, 1-mA"})
Copy link
Member

Choose a reason for hiding this comment

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

Please use textblock here

@github-actions github-actions bot added the status: changes-required Pull requests that are not yet complete label Nov 11, 2025
@koppor koppor added the dev: testing Related to tests label Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev: testing Related to tests status: changes-required Pull requests that are not yet complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants