aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com/squareup/javapoet/CodeWriterTest.java
blob: 331d000398eadcd7dfb7bd03df2e91af877afc2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.squareup.javapoet;

import org.junit.Test;

import java.io.IOException;

import static com.google.common.truth.Truth.assertThat;

public class CodeWriterTest {

    @Test
    public void emptyLineInJavaDocDosEndings() throws IOException {
        CodeBlock javadocCodeBlock = CodeBlock.of("A\r\n\r\nB\r\n");
        StringBuilder out = new StringBuilder();
        new CodeWriter(out).emitJavadoc(javadocCodeBlock);
        assertThat(out.toString()).isEqualTo(
                "/**\n" +
                        " * A\n" +
                        " *\n" +
                        " * B\n" +
                        " */\n");
    }
}