From 6eaaa87322b962687337ef8f8696d63da018ce60 Mon Sep 17 00:00:00 2001 From: Michael Dowling Date: Sat, 31 Oct 2020 09:00:56 -0700 Subject: [PATCH] Move test to smithy-utils and add trailing \n --- .../codegen/core/writer/CodegenWriterTest.java | 14 -------------- .../amazon/smithy/utils/CodeWriterTest.java | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/smithy-codegen-core/src/test/java/software/amazon/smithy/codegen/core/writer/CodegenWriterTest.java b/smithy-codegen-core/src/test/java/software/amazon/smithy/codegen/core/writer/CodegenWriterTest.java index 566347b9be2..44bad123c3f 100644 --- a/smithy-codegen-core/src/test/java/software/amazon/smithy/codegen/core/writer/CodegenWriterTest.java +++ b/smithy-codegen-core/src/test/java/software/amazon/smithy/codegen/core/writer/CodegenWriterTest.java @@ -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]")); - } } diff --git a/smithy-utils/src/test/java/software/amazon/smithy/utils/CodeWriterTest.java b/smithy-utils/src/test/java/software/amazon/smithy/utils/CodeWriterTest.java index bd5379cf62f..ac64ea1524c 100644 --- a/smithy-utils/src/test/java/software/amazon/smithy/utils/CodeWriterTest.java +++ b/smithy-utils/src/test/java/software/amazon/smithy/utils/CodeWriterTest.java @@ -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")); + } }