package net.sf.jabref.model.entry;

import org.junit.Assert;
import org.junit.Test;

public class CanonicalBibEntryTest {

    /**
     * Simple test for the canonical format
     */
    @Test
    public void canonicalRepresentation() {
        BibEntry e = new BibEntry("id", BibtexEntryTypes.ARTICLE);
        e.setField(BibEntry.KEY_FIELD, "key");
        e.setField("author", "abc");
        e.setField("title", "def");
        e.setField("journal", "hij");
        String canonicalRepresentation = CanonicalBibtexEntry.getCanonicalRepresentation(e);
        Assert.assertEquals("@article{key,\n  author = {abc},\n  journal = {hij},\n  title = {def}\n}",
                canonicalRepresentation);
    }

}

@@ -120,68 +120,8 @@
  %7B%0A%0A
-    /**%0A     * Simple test for the canonical format%0A     */%0A
     
@@ -142,17 +142,23 @@
 ic void 
-c
+simpleC
 anonical
@@ -647,10 +647,445 @@
 %0A    %7D%0A%0A
+    @Test%0A    public void canonicalRepresentationWithNewlines() %7B%0A        BibEntry e = new BibEntry(%22id%22, BibtexEntryTypes.ARTICLE);%0A        e.setField(BibEntry.KEY_FIELD, %22key%22);%0A        e.setField(%22abstract%22, %22line 1%5Cnline 2%22);%0A        String canonicalRepresentation = CanonicalBibtexEntry.getCanonicalRepresentation(e);%0A        Assert.assertEquals(%22@article%7Bkey,%5Cn  abstract = %7Bline 1%5Cnline 2%7D%5Cn%7D%22, canonicalRepresentation);%0A    %7D%0A%0A
 %7D%0A

Add multiline test for canonical representation