// Path: src/main/java/com/squareup/protoparser/Utils.java
// static void appendDocumentation(StringBuilder builder, String documentation) {
//   if (documentation.isEmpty()) {
//     return;
//   }
//   for (String line : documentation.split("\n")) {
//     builder.append("// ").append(line).append('\n');
//   }
// }
// 
// Path: src/main/java/com/squareup/protoparser/Utils.java
// static void appendIndented(StringBuilder builder, String value) {
//   for (String line : value.split("\n")) {
//     builder.append("  ").append(line).append('\n');
//   }
// }


import org.junit.Test;
import static com.squareup.protoparser.Utils.appendDocumentation;
import static com.squareup.protoparser.Utils.appendIndented;
import static org.assertj.core.api.Assertions.assertThat;
package com.squareup.protoparser;



public class UtilsTest {
  @Test public void indentationTest() {
    String input = "Foo\nBar\nBaz";
    String expected = "  Foo\n  Bar\n  Baz\n";
    StringBuilder builder = new StringBuilder();
    appendIndented(builder, input);
    assertThat(builder.toString()).isEqualTo(expected);
  }

  @Test public void documentationTest() {
    String input = "Foo\nBar\nBaz";
    String expected = ""
        + "// Foo\n"
        + "// Bar\n"
        + "// Baz\n";
    StringBuilder builder = new StringBuilder();
// Path: src/main/java/com/squareup/protoparser/Utils.java
// static void appendDocumentation(StringBuilder builder, String documentation) {
//   if (documentation.isEmpty()) {
//     return;
//   }
//   for (String line : documentation.split("\n")) {
//     builder.append("// ").append(line).append('\n');
//   }
// }
// 
// Path: src/main/java/com/squareup/protoparser/Utils.java
// static void appendIndented(StringBuilder builder, String value) {
//   for (String line : value.split("\n")) {
//     builder.append("  ").append(line).append('\n');
//   }
// }


// Path: src/test/java/com/squareup/protoparser/UtilsTest.java
import org.junit.Test;
import static com.squareup.protoparser.Utils.appendDocumentation;
import static com.squareup.protoparser.Utils.appendIndented;
import static org.assertj.core.api.Assertions.assertThat;

package com.squareup.protoparser;



public class UtilsTest {
  @Test public void indentationTest() {
    String input = "Foo\nBar\nBaz";
    String expected = "  Foo\n  Bar\n  Baz\n";
    StringBuilder builder = new StringBuilder();
    appendIndented(builder, input);
    assertThat(builder.toString()).isEqualTo(expected);
  }

  @Test public void documentationTest() {
    String input = "Foo\nBar\nBaz";
    String expected = ""
        + "// Foo\n"
        + "// Bar\n"
        + "// Baz\n";
    StringBuilder builder = new StringBuilder();
    appendDocumentation(builder, input);