From 4533e7362f5753dc652ee27a1f487a8a8cd98b20 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Sat, 10 Dec 2016 18:52:52 +0100 Subject: [PATCH] Make sure that #2334 is fixed --- CHANGELOG.md | 2 ++ .../jabref/model/groups/ExplicitGroupTest.java | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebdf3e46b26..41751e41362 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,8 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# The pattern can be specified in the settings like the filename pattern. [#1092](https://github.com/JabRef/jabref/issues/1092) ### Fixed +- We fixed a few groups related issues: + - "Remove entries from group" no longer removes entries from groups with similar names. [#2334](https://github.com/JabRef/jabref/issues/2334) - We fixed an issue which prevented JabRef from closing using the "Quit" menu command. [#2336](https://github.com/JabRef/jabref/issues/2336) - We fixed an issue where the file permissions of the .bib-file were changed upon saving [#2279](https://github.com/JabRef/jabref/issues/2279). - We fixed an issue which prevented that a database was saved successfully if JabRef failed to generate new BibTeX-keys [#2285](https://github.com/JabRef/jabref/issues/2285). diff --git a/src/test/java/net/sf/jabref/model/groups/ExplicitGroupTest.java b/src/test/java/net/sf/jabref/model/groups/ExplicitGroupTest.java index ace76bfc9c4..9d0ae77d894 100644 --- a/src/test/java/net/sf/jabref/model/groups/ExplicitGroupTest.java +++ b/src/test/java/net/sf/jabref/model/groups/ExplicitGroupTest.java @@ -55,4 +55,21 @@ public void addDuplicateGroupDoesNotChangeGroupsField() throws Exception { assertEquals(Optional.of("myExplicitGroup"), entry.getField(FieldName.GROUPS)); } + @Test + // For https://github.com/JabRef/jabref/issues/2334 + public void removeDoesNotChangeFieldIfContainsNameAsPart() throws Exception { + entry.setField(FieldName.GROUPS, "myExplicitGroup_alternative"); + group.remove(entry); + + assertEquals(Optional.of("myExplicitGroup_alternative"), entry.getField(FieldName.GROUPS)); + } + + @Test + // For https://github.com/JabRef/jabref/issues/2334 + public void removeDoesNotChangeFieldIfContainsNameAsWord() throws Exception { + entry.setField(FieldName.GROUPS, "myExplicitGroup alternative"); + group.remove(entry); + + assertEquals(Optional.of("myExplicitGroup alternative"), entry.getField(FieldName.GROUPS)); + } }