Skip to content

Commit

Permalink
Do not append '\n' for param name. (#152)
Browse files Browse the repository at this point in the history
May fix #129
  • Loading branch information
croudet authored Feb 18, 2020
1 parent 90d7a90 commit 2523eea
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public JavadocDescription parse(String text) {
currentDescription = new StringBuilder();
state = PARAM_DESC;
previousState = PARAM_DESC;
} else {
} else if (c != '\n') {
currentParam.append(c);
}
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ with more return description
as it is multiline
''')


expect:
desc.methodDescription
desc.returnDescription
Expand All @@ -105,4 +104,27 @@ with more return description
as it is multiline'''

}

void 'test parse multiline javadoc param'() {

given:
JavadocParser parser = new JavadocParser()
JavadocDescription desc = parser.parse('''
Check if the given user has access to RabbitMQ.
@param username
The username to check.
@param password
The password to check.
@return 'allow' or 'deny' and user tags.
''')

expect:
desc.methodDescription
desc.returnDescription
desc.parameters.size() == 2
desc.parameters['username'] == 'The username to check.'
desc.parameters['password'] == 'The password to check.'
}
}

0 comments on commit 2523eea

Please sign in to comment.