Skip to content

Commit

Permalink
Make sure that JabRef#1681 is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez committed Dec 10, 2016
1 parent cf5224b commit 74be920
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- 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)
- If an entry's group field contains 'a b' it is no longer considered a member the groups 'a', 'b', and 'a b'. [1873](https://github.com/JabRef/jabref/issues/1873)
- Reading and writing now works for groups that contain special escaped characters in their names. [1681](https://github.com/JabRef/jabref/issues/1681)
- 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).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ public void serializeSingleExplicitGroup() {
assertEquals(Collections.singletonList("0 ExplicitGroup:myExplicitGroup;0;"), serialization);
}

@Test
// For https://github.com/JabRef/jabref/issues/1681
public void serializeSingleExplicitGroupWithEscapedSlash() {
ExplicitGroup group = new ExplicitGroup("B{\\\"{o}}hmer", GroupHierarchyType.INDEPENDENT, ',');
List<String> serialization = groupSerializer.serializeTree(GroupTreeNode.fromGroup(group));
assertEquals(Collections.singletonList("0 ExplicitGroup:B{\\\\\"{o}}hmer;0;"), serialization);
}

@Test
public void serializeSingleSimpleKeywordGroup() {
SimpleKeywordGroup group = new SimpleKeywordGroup("name", GroupHierarchyType.INDEPENDENT, "keywords", "test", false, ',', false);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package net.sf.jabref.logic.importer.util;

import net.sf.jabref.model.groups.AbstractGroup;
import net.sf.jabref.model.groups.ExplicitGroup;
import net.sf.jabref.model.groups.GroupHierarchyType;

import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.*;

public class GroupsParserTest {

@Test
// For https://github.com/JabRef/jabref/issues/1681
public void fromStringParsesExplicitGroupWithEscapedCharacterInName() throws Exception {
ExplicitGroup expected = new ExplicitGroup("B{\\\"{o}}hmer", GroupHierarchyType.INDEPENDENT, ',');
AbstractGroup parsed = GroupsParser.fromString("ExplicitGroup:B{\\\\\"{o}}hmer;0;", ',');

assertEquals(expected, parsed);
}

}

0 comments on commit 74be920

Please sign in to comment.