Skip to content

Commit 7efa8d2

Browse files
Munhangyeolsubhramitkoppor
authored
test: adapt CSLFormatUtilsTest expectations to use full month name 'July' (#13465)
* test: adapt CSLFormatUtilsTest expectations to use full month name 'July' * Update csl-locales * Chore: Fixed the code to comply with JabRef's Checkstyle * Fix: Update expected month abbreviation from Jul. to July in CitationStyleGeneratorTest --------- Co-authored-by: Subhramit Basu <subhramit.bb@live.in> Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
1 parent c213c5e commit 7efa8d2

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

jablib/src/test/java/org/jabref/logic/citationstyle/CitationStyleGeneratorTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void defaultBibliography() {
8686
// if the default citation style (ieee.csl) changes this has to be modified
8787
String expected = """
8888
<div class="csl-entry">
89-
<div class="csl-left-margin">[1]</div><div class="csl-right-inline">B. Smith, B. Jones, and J. Williams, &ldquo;Title of the test entry,&rdquo; <span style="font-style: italic">BibTeX Journal</span>, vol. 34, no. 3, pp. 45&ndash;67, Jul. 2016, doi: 10.1001/bla.blubb.</div>
89+
<div class="csl-left-margin">[1]</div><div class="csl-right-inline">B. Smith, B. Jones, and J. Williams, &ldquo;Title of the test entry,&rdquo; <span style="font-style: italic">BibTeX Journal</span>, vol. 34, no. 3, pp. 45&ndash;67, July 2016, doi: 10.1001/bla.blubb.</div>
9090
</div>
9191
""";
9292

@@ -169,7 +169,7 @@ void missingCitationStyle() {
169169
@Test
170170
void htmlFormat() {
171171
String expectedCitation = " <div class=\"csl-entry\">\n" +
172-
" <div class=\"csl-left-margin\">[1]</div><div class=\"csl-right-inline\">B. Smith, B. Jones, and J. Williams, &ldquo;Title of the test entry,&rdquo; <span style=\"font-style: italic\">BibTeX Journal</span>, vol. 34, no. 3, pp. 45&ndash;67, Jul. 2016, doi: 10.1001/bla.blubb.</div>\n" +
172+
" <div class=\"csl-left-margin\">[1]</div><div class=\"csl-right-inline\">B. Smith, B. Jones, and J. Williams, &ldquo;Title of the test entry,&rdquo; <span style=\"font-style: italic\">BibTeX Journal</span>, vol. 34, no. 3, pp. 45&ndash;67, July 2016, doi: 10.1001/bla.blubb.</div>\n" +
173173
" </div>\n";
174174

175175
String actualCitation = CitationStyleGenerator.generateBibliography(List.of(testEntry), DEFAULT_STYLE, HTML_OUTPUT_FORMAT, testEntryContext, ENTRY_TYPES_MANAGER).getFirst();
@@ -178,7 +178,7 @@ void htmlFormat() {
178178

179179
@Test
180180
void textFormat() {
181-
String expectedCitation = "[1]B. Smith, B. Jones, and J. Williams, “Title of the test entry,” BibTeX Journal, vol. 34, no. 3, pp. 45–67, Jul. 2016, doi: 10.1001/bla.blubb.\n";
181+
String expectedCitation = "[1]B. Smith, B. Jones, and J. Williams, “Title of the test entry,” BibTeX Journal, vol. 34, no. 3, pp. 45–67, July 2016, doi: 10.1001/bla.blubb.\n";
182182

183183
String actualCitation = CitationStyleGenerator.generateBibliography(List.of(testEntry), DEFAULT_STYLE, TEXT_OUTPUT_FORMAT, testEntryContext, ENTRY_TYPES_MANAGER).getFirst();
184184
assertEquals(expectedCitation, actualCitation);
@@ -201,7 +201,7 @@ void handleDiacritics() {
201201

202202
@Test
203203
void handleAmpersand() {
204-
String expectedCitation = "[1]B. Smith, B. Jones, and J. Williams, “Famous quote: “&TitleTest&” - that is it,” BibTeX Journal, vol. 34, no. 3, pp. 45–67, Jul. 2016, doi: 10.1001/bla.blubb.\n";
204+
String expectedCitation = "[1]B. Smith, B. Jones, and J. Williams, “Famous quote: “&TitleTest&” - that is it,” BibTeX Journal, vol. 34, no. 3, pp. 45–67, July 2016, doi: 10.1001/bla.blubb.\n";
205205
testEntry.setField(StandardField.TITLE, "Famous quote: “&TitleTest&” - that is it");
206206

207207
String actualCitation = CitationStyleGenerator.generateBibliography(List.of(testEntry), DEFAULT_STYLE, TEXT_OUTPUT_FORMAT, testEntryContext, ENTRY_TYPES_MANAGER).getFirst();

jablib/src/test/java/org/jabref/logic/openoffice/oocsltext/CSLFormatUtilsTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ static Stream<Arguments> ooHTMLTransformFromRawBibliography() {
165165

166166
// Numeric type "[1]", brackets, newlines
167167
Arguments.of(
168-
"[1] B. Smith, B. Jones, and J. Williams, “Title of the test entry,” <i>BibTeX Journal</i>, vol. 34, no. 3, pp. 45–67, Jul. 2016, doi: 10.1001/bla.blubb.<p></p>",
168+
"[1] B. Smith, B. Jones, and J. Williams, “Title of the test entry,” <i>BibTeX Journal</i>, vol. 34, no. 3, pp. 45–67, July 2016, doi: 10.1001/bla.blubb.<p></p>",
169169
STYLE_LIST.stream().filter(e -> "IEEE".equals(e.getTitle())).findAny().get()
170170
),
171171

@@ -182,7 +182,7 @@ static Stream<Arguments> ooHTMLTransformFromRawBibliography() {
182182

183183
// Semicolons
184184
Arguments.of(
185-
"1. Smith B, Jones B, Williams J. Title of the test entry. Taylor P, editor. BibTeX Journal [Internet]. 2016 Jul;34(3):45–67. Available from: https://github.com/JabRef<p></p>",
185+
"1. Smith B, Jones B, Williams J. Title of the test entry. Taylor P, editor. BibTeX Journal [Internet]. 2016 July;34(3):45–67. Available from: https://github.com/JabRef<p></p>",
186186
STYLE_LIST.stream().filter(e -> "Vancouver".equals(e.getTitle())).findAny().get()
187187
),
188188

@@ -511,7 +511,7 @@ static Stream<Arguments> updateSingleNumericBibliography() {
511511

512512
// Type: "[1]"
513513
Arguments.of(
514-
"[3] B. Smith, B. Jones, and J. Williams, “Title of the test entry,” <i>BibTeX Journal</i>, vol. 34, no. 3, pp. 45–67, Jul. 2016, doi: 10.1001/bla.blubb.<p></p>",
514+
"[3] B. Smith, B. Jones, and J. Williams, “Title of the test entry,” <i>BibTeX Journal</i>, vol. 34, no. 3, pp. 45–67, July 2016, doi: 10.1001/bla.blubb.<p></p>",
515515
STYLE_LIST.stream().filter(e -> "IEEE".equals(e.getTitle())).findAny().get()
516516
),
517517

0 commit comments

Comments
 (0)