Skip to content

Commit

Permalink
Move test to smithy-utils and add trailing \n
Browse files Browse the repository at this point in the history
  • Loading branch information
mtdowling committed Oct 31, 2020
1 parent e5a3bee commit 6eaaa87
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,4 @@ public void importsUseReferencesFromSymbols() {
assertThat(writer.getImportContainer().imports, hasKey("MyString"));
assertThat(writer.getImportContainer().imports.get("MyString"), equalTo("java.lang.String"));
}

@Test
public void canComposeSetWithSection() {
String testSection = "testSection";
MyWriter writer = new MyWriter("foo");

writer.onSection(testSection, text -> writer.write(text + "1, "));
writer.onSection(testSection, text -> writer.write(text + "2, "));
writer.onSection(testSection, text -> writer.write(text + "3"));

writer.write("[${L@testSection}]", "");

assertThat(writer.toString(), equalTo("[1, 2, 3]"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -682,4 +682,18 @@ public void canFilterSections() {

assertThat(writer.toString(), equalTo("HELLO!\nGOODBYE!\n"));
}

@Test
public void canComposeSetWithSection() {
String testSection = "testSection";
CodeWriter writer = new CodeWriter();

writer.onSection(testSection, text -> writer.write(text + "1, "));
writer.onSection(testSection, text -> writer.write(text + "2, "));
writer.onSection(testSection, text -> writer.write(text + "3"));

writer.write("[${L@testSection}]", "");

assertThat(writer.toString(), equalTo("[1, 2, 3]\n"));
}
}

0 comments on commit 6eaaa87

Please sign in to comment.