• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package com.squareup.javapoet;
2 
3 import org.junit.Test;
4 
5 import java.io.IOException;
6 
7 import static com.google.common.truth.Truth.assertThat;
8 
9 public class CodeWriterTest {
10 
11     @Test
emptyLineInJavaDocDosEndings()12     public void emptyLineInJavaDocDosEndings() throws IOException {
13         CodeBlock javadocCodeBlock = CodeBlock.of("A\r\n\r\nB\r\n");
14         StringBuilder out = new StringBuilder();
15         new CodeWriter(out).emitJavadoc(javadocCodeBlock);
16         assertThat(out.toString()).isEqualTo(
17                 "/**\n" +
18                         " * A\n" +
19                         " *\n" +
20                         " * B\n" +
21                         " */\n");
22     }
23 }