Permalink
Browse files

DocumentationComment.py: Improve `assemble()`

assemble() accounts for `marker[1]==marker[2]`
Fixes #2645
  • Loading branch information...
damngamerz committed Jun 6, 2017
1 parent e585c07 commit c79ec5a53206d1d8b23d272828c2459f87e0d9da
@@ -221,6 +221,7 @@ def assemble(self):
assembled += ''.join('\n' if line == '\n' and not self.marker[1]
else self.indent + self.marker[1] + line
for line in lines[1:])
return (assembled +
(self.indent if lines[-1][-1] == '\n' else '') +
self.marker[2])
return (assembled if self.marker[1] == self.marker[2] else
(assembled +
(self.indent if lines[-1][-1] == '\n' else '') +
self.marker[2]))
@@ -222,6 +222,13 @@ def test_python_assembly(self):
for doc in extract_documentation(data, 'python', 'default'):
self.assertIn(doc.assemble(), docs)
def test_doxygen_assembly(self):
data = load_testdata('doxygen.py')
docs = ''.join(data)
for doc in extract_documentation(data, 'python', 'doxygen'):
self.assertIn(doc.assemble(), docs)
def test_c_assembly(self):
data = load_testdata('default.c')
docs = ''.join(data)

0 comments on commit c79ec5a

Please sign in to comment.