From 79313f225841f3d839976c0a8caa35e7f6da4b42 Mon Sep 17 00:00:00 2001 From: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com> Date: Sun, 8 Sep 2024 00:28:02 +0200 Subject: [PATCH] Add parser test --- .../logic/importer/fileformat/BibtexParserTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/java/org/jabref/logic/importer/fileformat/BibtexParserTest.java b/src/test/java/org/jabref/logic/importer/fileformat/BibtexParserTest.java index f0ff769ee1c..e38ab786aaa 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/BibtexParserTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/BibtexParserTest.java @@ -662,6 +662,18 @@ void parseRecognizesFieldsWithEscapedQuotationMarks() throws IOException { assertEquals(List.of(expected), result.getDatabase().getEntries()); } + @Test + void parseRecognizesFieldsWithQuotationMarksInBrackets() throws IOException { + ParserResult result = parser + .parse(new StringReader("@article{test,title=\"Comments on {\"}Filenames and Fonts{\"}\"}")); + + BibEntry expected = new BibEntry(StandardEntryType.Article) + .withCitationKey("test") + .withField(StandardField.TITLE, "Comments on {\"}Filenames and Fonts{\"}"); + + assertEquals(List.of(expected), result.getDatabase().getEntries()); + } + @Test void parseIgnoresAndWarnsAboutEntryWithFieldsThatAreNotSeperatedByComma() throws IOException { ParserResult result = parser