package org.commonmark.test;

import org.junit.Test;

public class SpecialInputTest extends RenderingTestCase {

    @Test
    public void nullCharacterShouldBeReplaced() {
        assertRendering("foo\0bar", "<p>foo\uFFFDbar</p>\n");
    }

    @Test
    public void nullCharacterEntityShouldBeReplaced() {
        assertRendering("foo&#0;bar", "<p>foo\uFFFDbar</p>\n");
    }

    @Test
    public void crLfAsLineSeparatorShouldBeParsed() {
        assertRendering("foo\r\nbar", "<p>foo\nbar</p>\n");
    }

    @Test
    public void crLfAtEndShouldBeParsed() {
        assertRendering("foo\r\n", "<p>foo</p>\n");
    }

    @Test
    public void surrogatePair() {
        assertRendering("surrogate pair: \uD834\uDD1E", "<p>surrogate pair: \uD834\uDD1E</p>\n");
    }

    @Test
    public void surrogatePairInLinkDestination() {
        assertRendering("[title](\uD834\uDD1E)", "<p><a href=\"\uD834\uDD1E\">title</a></p>\n");
    }

}

@@ -608,32 +608,203 @@
 /p%3E%5Cn%22);%0A    %7D%0A%0A
+    @Test%0A    public void mixedLineSeparators() %7B%0A        assertRendering(%22- a%5Cn- b%5Cr- c%5Cr%5Cn- d%22, %22%3Cul%3E%5Cn%3Cli%3Ea%3C/li%3E%5Cn%3Cli%3Eb%3C/li%3E%5Cn%3Cli%3Ec%3C/li%3E%5Cn%3Cli%3Ed%3C/li%3E%5Cn%3C/ul%3E%5Cn%22);%0A    %7D%0A%0A
     @Test%0A    pu

Add test for mixed line separators