updated two additonal tests for python doxygen code comments
This commit is contained in:
parent
ee3e4024a6
commit
08093ec17e
2 changed files with 136 additions and 37 deletions
|
|
@ -3,45 +3,60 @@
|
|||
import doxygen_parsing
|
||||
import string
|
||||
import sys
|
||||
import commentVerifier
|
||||
|
||||
def check(got, expected):
|
||||
#if got is Null
|
||||
# raise RuntimeError('Expected comment string\n')
|
||||
gotStr = string.replace(got, ' ', '')
|
||||
gotStr = string.replace(gotStr, '\n', '')
|
||||
gotStr = string.replace(gotStr, '\t', '')
|
||||
expectedStr = string.replace(expected, ' ', '')
|
||||
expectedStr = string.replace(expectedStr, '\n', '')
|
||||
expectedStr = string.replace(expectedStr, '\t', '')
|
||||
if not gotStr == expectedStr:
|
||||
raise RuntimeError("Expected: [" + str(expected) + "]\n" + "Got : [" + str(got) + "]\n")
|
||||
commentVerifier.check(doxygen_parsing.someFunction.__doc__,
|
||||
r"""
|
||||
The function comment
|
||||
""")
|
||||
commentVerifier.check(doxygen_parsing.SomeClass.__doc__,
|
||||
r"""
|
||||
The class comment
|
||||
""")
|
||||
commentVerifier.check(doxygen_parsing.SomeStruct.__doc__,
|
||||
r"""
|
||||
The struct comment
|
||||
""")
|
||||
commentVerifier.check(doxygen_parsing.SomeAnotherClass.classMethod.__doc__,
|
||||
r"""
|
||||
The class method comment
|
||||
""")
|
||||
commentVerifier.check(doxygen_parsing.SomeAnotherClass.classMethodExtended.__doc__,
|
||||
r"""
|
||||
The class method with parameter
|
||||
|
||||
check(doxygen_parsing.someFunction.__doc__, 'The function comment')
|
||||
check(doxygen_parsing.SomeClass.__doc__, 'The class comment')
|
||||
check(doxygen_parsing.SomeStruct.__doc__, 'The struct comment')
|
||||
check(doxygen_parsing.SomeAnotherClass.classMethod.__doc__, 'The class method comment')
|
||||
check(doxygen_parsing.SomeAnotherClass.classMethodExtended.__doc__, ''
|
||||
'The class method with parameter\n'
|
||||
'Arguments:\n'
|
||||
'a (int) -- Parameter a\n'
|
||||
'b (int) -- Parameter b\n'
|
||||
Arguments:
|
||||
a (int) -- Parameter a
|
||||
b (int) -- Parameter b
|
||||
"""
|
||||
)
|
||||
check(doxygen_parsing.SomeAnotherClass.classMethodExtended2.__doc__, ''
|
||||
'The class method with parameter\n'
|
||||
'Arguments:\n'
|
||||
'a (int)-- Parameter a\n'
|
||||
'b (int)-- Parameter b\n'
|
||||
commentVerifier.check(doxygen_parsing.SomeAnotherClass.classMethodExtended2.__doc__,
|
||||
r"""
|
||||
The class method with parameter
|
||||
|
||||
Arguments:
|
||||
a (int) -- Parameter a
|
||||
b (int) -- Parameter b
|
||||
"""
|
||||
)
|
||||
check(doxygen_parsing.SomeAnotherStruct.structMethod.__doc__, 'The struct method comment')
|
||||
check(doxygen_parsing.SomeAnotherStruct.structMethodExtended.__doc__, ''
|
||||
'The struct method with parameter\n'
|
||||
'Arguments:\n'
|
||||
'a (int)-- Parameter a\n'
|
||||
'b (int)-- Parameter b\n'
|
||||
commentVerifier.check(doxygen_parsing.SomeAnotherStruct.structMethod.__doc__,
|
||||
r"""
|
||||
The struct method comment
|
||||
""")
|
||||
commentVerifier.check(doxygen_parsing.SomeAnotherStruct.structMethodExtended.__doc__,
|
||||
r"""
|
||||
The struct method with parameter
|
||||
|
||||
Arguments:
|
||||
a (int) -- Parameter a
|
||||
b (int) -- Parameter b
|
||||
"""
|
||||
)
|
||||
check(doxygen_parsing.SomeAnotherStruct.structMethodExtended2.__doc__, ''
|
||||
'The struct method with parameter\n'
|
||||
'Arguments:\n'
|
||||
'a (int)-- Parameter a\n'
|
||||
'b (int)-- Parameter b\n'
|
||||
)
|
||||
commentVerifier.check(doxygen_parsing.SomeAnotherStruct.structMethodExtended2.__doc__,
|
||||
r"""
|
||||
The struct method with parameter
|
||||
|
||||
Arguments:
|
||||
a (int) -- Parameter a
|
||||
b (int) -- Parameter b
|
||||
""")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue