Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
db2166de
Commit
db2166de
authored
Jan 10, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extended (failing) test cases
parent
62335406
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
28 deletions
+44
-28
tests/run/r_docstrings.pyx
tests/run/r_docstrings.pyx
+41
-25
tests/run/strliterals.pyx
tests/run/strliterals.pyx
+3
-3
No files found.
tests/run/r_docstrings.pyx
View file @
db2166de
...
...
@@ -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__
>>>
Py
C.__doc__
u'
\
\
n This is a class docstring.
\
\
n
'
>>>
Py
CS.__doc__
u'
\
\
n This is a subclass docstring.
\
\
n
'
>>>
Py
CSS.__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
tests/run/strliterals.pyx
View file @
db2166de
...
...
@@ -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)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment