Skip to content

Commit a6ff641

Browse files
committed
Update JavadocParserTest.java
1 parent 7f6f355 commit a6ff641

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

http-generator-core/src/test/java/io/avaje/http/generator/core/javadoc/JavadocParserTest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,22 @@ public void lines() {
145145
assertThat(parser.mergeLines("\n one \n two \n three \n")).isEqualTo("one two three");
146146

147147
}
148+
149+
@Test
150+
public void parse_param_with_newline() {
151+
152+
JavadocParser parser = new JavadocParser();
153+
154+
Javadoc doc = parser.parse(
155+
"This is a description with <b>bold</b> and {@code some code}\n" +
156+
"@since 1.0\n" +
157+
"@param foo The\n foo param\n" +
158+
"@param bar The {@code \n} param\n" +
159+
"@return The {@value return}\n value\n");
160+
161+
assertEquals("This is a description with bold and some code", doc.getSummary());
162+
assertEquals("The foo param", doc.getParams().get("foo"));
163+
assertEquals("The \\n param", doc.getParams().get("bar"));
164+
assertEquals("The return value", doc.getReturnDescription());
165+
}
148166
}

0 commit comments

Comments
 (0)