Commit db2166de authored by Stefan Behnel's avatar Stefan Behnel

extended (failing) test cases

parent 62335406
......@@ -10,40 +10,46 @@ doctest = u"""# Python 3 gets all of these right ...
'A module docstring'
>>> f.__doc__
'This is a function docstring.'
'\\n This is a function docstring.\\n '
>>> C.__doc__
'This is a class docstring.'
'\\n This is a class docstring.\\n '
>>> CS.__doc__
'This is a subclass docstring.'
'\\n This is a subclass docstring.\\n '
>>> print(CSS.__doc__)
None
>>> T.__doc__
'This is an extension type docstring.'
'\\n This is an extension type docstring.\\n '
>>> TS.__doc__
'This is an extension subtype docstring.'
'\\n This is an extension subtype docstring.\\n '
>>> TSS.__doc__
Compare with standard Python:
>>> def f():
... u'This is a function docstring.'
>>> f.__doc__
u'This is a function docstring.'
>>> class C:
... u'This is a class docstring.'
>>> class CS(C):
... u'This is a subclass docstring.'
>>> class CSS(CS):
>>> def Pyf():
... u'''
... This is a function docstring.
... '''
>>> Pyf.__doc__
u'\\n This is a function docstring.\\n '
>>> class PyC:
... u'''
... This is a class docstring.
... '''
>>> class PyCS(C):
... u'''
... This is a subclass docstring.
... '''
>>> class PyCSS(CS):
... pass
>>> C.__doc__
u'This is a class docstring.'
>>> CS.__doc__
u'This is a subclass docstring.'
>>> CSS.__doc__
>>> PyC.__doc__
u'\\n This is a class docstring.\\n '
>>> PyCS.__doc__
u'\\n This is a subclass docstring.\\n '
>>> PyCSS.__doc__
"""
import sys
......@@ -53,22 +59,32 @@ if sys.version_info[0] >= 3:
__test__ = {u"test_docstrings" : doctest}
def f():
u"This is a function docstring."
u"""
This is a function docstring.
"""
class C:
u"This is a class docstring."
u"""
This is a class docstring.
"""
class CS(C):
u"This is a subclass docstring."
u"""
This is a subclass docstring.
"""
class CSS(CS):
pass
cdef class T:
u"This is an extension type docstring."
u"""
This is an extension type docstring.
"""
cdef class TS(T):
u"This is an extension subtype docstring."
u"""
This is an extension subtype docstring.
"""
cdef class TSS(TS):
pass
......@@ -148,9 +148,9 @@ __doc__ = ur"""
... sys.version_info[0] >= 3 and ord(str_uescape[-2]) or str_uescape[-12:-1])
True
>>> newlines == "Aaa\n"
True
>>> newlines
'Aaa\n'
>>> len(long_escapes)
3033
>>> len(even_lots_of_slashes)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment