Skip to content

Commit ac7e28d

Browse files
author
Chase Coalwell
committed
test multi-line close in doc string
1 parent 87b7b15 commit ac7e28d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/TypeScriptWriterTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@ public void escapesDollarInDocStrings() {
3636
assertThat(result, equalTo("/**\n * " + docs + "\n */\n"));
3737
}
3838

39+
@Test
40+
public void escapesMultiLineCloseInDocStrings() {
41+
String docs = "This is */ valid documentation.";
42+
43+
TypeScriptWriter writer = new TypeScriptWriter("foo");
44+
writer.writeDocs(docs);
45+
String result = writer.toString();
46+
47+
assertThat(result, equalTo("/**\n * This is *\\/ valid documentation.\n */\n"));
48+
}
49+
3950
@Test
4051
public void addsFormatterForSymbols() {
4152
// TODO

0 commit comments

Comments
 (0)