assertEquals("2002", e.getField("year"));
}
public void testNewlineHandling() throws IOException {
BibtexEntry e = BibtexParser.singleFromString("@article{canh05," +
"a = {a\nb}," +
"b = {a\n\nb}," +
"c = {a\n \nb}," +
"d = {a \n \n b},"
+ "title = {\nHallo \nWorld \nthis \n is\n\nnot \n\nan \n\n exercise \n \n.\n \n\n},\n"
+ "tabs = {\nHallo \tWorld \tthis \t is\t\tnot \t\tan \t\n exercise \t \n.\t \n\t},\n"
+ "file = {Bemerkung:H:\\bla\\ups sala.pdf:PDF}, \n"
+ "}");
assertEquals("canh05", e.getCiteKey());
assertEquals(BibtexEntryType.ARTICLE, e.getType());
assertEquals("a b", e.getField("a"));
assertEquals("a\nb", e.getField("b"));
assertEquals("a b", e.getField("c"));
assertEquals("a b", e.getField("d"));
// I think the last \n is a bug in the parser...
assertEquals("Hallo World this is\nnot \nan \n exercise . \n\n", e.getField("title"));
assertEquals("Hallo World this isnot an exercise . ", e.getField("tabs"));
}