Don't indent Doxygen doc strings in generated Python code.
This is unnecessary and inconsistent with "builtin" case in which the docstrings are not indented in the generated C++ code, thus making it impossible to write tests working in both cases. Most of the changes in this commit simply remove the extra whitespace from the expected values in the tests.
This commit is contained in:
parent
9b857e6cf1
commit
410b508e9a
9 changed files with 471 additions and 535 deletions
|
|
@ -7,80 +7,74 @@ import commentVerifier
|
|||
|
||||
commentVerifier.check(doxygen_basic_translate.function.__doc__,
|
||||
"""
|
||||
Brief description.
|
||||
|
||||
The comment text.
|
||||
Brief description.
|
||||
|
||||
Author: Some author
|
||||
The comment text.
|
||||
|
||||
:rtype: int
|
||||
:return: Some number
|
||||
Author: Some author
|
||||
|
||||
See also: function2
|
||||
"""
|
||||
:rtype: int
|
||||
:return: Some number
|
||||
|
||||
See also: function2"""
|
||||
)
|
||||
commentVerifier.check(doxygen_basic_translate.function2.__doc__,
|
||||
"""
|
||||
A test of a very very very very very very very very very very very very very very very very
|
||||
very very very very very long comment string.
|
||||
"""
|
||||
A test of a very very very very very very very very very very very very very very very very
|
||||
very very very very very long comment string."""
|
||||
)
|
||||
commentVerifier.check(doxygen_basic_translate.function3.__doc__,
|
||||
"""
|
||||
*Overload 1:*
|
||||
"""*Overload 1:*
|
||||
|
||||
A test for overloaded functions
|
||||
This is function **one**
|
||||
A test for overloaded functions
|
||||
This is function **one**
|
||||
|
||||
|
|
||||
|
|
||||
|
||||
*Overload 2:*
|
||||
*Overload 2:*
|
||||
|
||||
A test for overloaded functions
|
||||
This is function **two**
|
||||
"""
|
||||
A test for overloaded functions
|
||||
This is function **two**"""
|
||||
)
|
||||
commentVerifier.check(doxygen_basic_translate.function4.__doc__,
|
||||
"""
|
||||
A test of some mixed tag usage
|
||||
If: CONDITION {
|
||||
This *code* fragment shows us something .
|
||||
Title: Minuses:
|
||||
* it\'s senseless
|
||||
* it\'s stupid
|
||||
* it\'s null
|
||||
A test of some mixed tag usage
|
||||
If: CONDITION {
|
||||
This *code* fragment shows us something .
|
||||
Title: Minuses:
|
||||
* it\'s senseless
|
||||
* it\'s stupid
|
||||
* it\'s null
|
||||
|
||||
Warning: This may not work as expected
|
||||
Warning: This may not work as expected
|
||||
|
||||
.. code-block:: c++
|
||||
.. code-block:: c++
|
||||
|
||||
|
||||
int main() { while(true); }
|
||||
int main() { while(true); }
|
||||
|
||||
}
|
||||
"""
|
||||
}"""
|
||||
)
|
||||
commentVerifier.check(doxygen_basic_translate.function5.__doc__,
|
||||
""" This is a post comment."""
|
||||
)
|
||||
commentVerifier.check(doxygen_basic_translate.function6.__doc__,
|
||||
"""
|
||||
Test for default args
|
||||
:type a: int
|
||||
:param a: Some parameter, default is 42
|
||||
"""
|
||||
Test for default args
|
||||
:type a: int
|
||||
:param a: Some parameter, default is 42"""
|
||||
)
|
||||
commentVerifier.check(doxygen_basic_translate.function7.__doc__,
|
||||
"""
|
||||
Test for a parameter with difficult type
|
||||
(mostly for python)
|
||||
:type a: :py:class:`Shape`
|
||||
:param a: Very strange param
|
||||
"""
|
||||
Test for a parameter with difficult type
|
||||
(mostly for python)
|
||||
:type a: :py:class:`Shape`
|
||||
:param a: Very strange param"""
|
||||
)
|
||||
|
||||
commentVerifier.check(doxygen_basic_translate.Atan2.__doc__,
|
||||
"""
|
||||
"""
|
||||
Multiple parameters test.
|
||||
|
||||
:type y: float
|
||||
|
|
@ -88,6 +82,5 @@ commentVerifier.check(doxygen_basic_translate.Atan2.__doc__,
|
|||
:type x: float
|
||||
:param x: Horizontal coordinate.
|
||||
:rtype: float
|
||||
:return: Arc tangent of ``y/x``.
|
||||
"""
|
||||
:return: Arc tangent of ``y/x``."""
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue