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
dcd13ee0
Commit
dcd13ee0
authored
8 years ago
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test for AnnotationCCodeWriter
parent
96c2ce10
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
0 deletions
+65
-0
tests/run/annotate_html.pyx
tests/run/annotate_html.pyx
+65
-0
No files found.
tests/run/annotate_html.pyx
0 → 100644
View file @
dcd13ee0
"""
>>> import os.path as os_path
>>> module_path = os_path.join(os_path.dirname(__file__), os_path.basename(__file__).split('.', 1)[0])
>>> assert module_path.endswith('annotate_html')
>>> assert os_path.exists(module_path + '.c'), module_path
>>> assert os_path.exists(module_path + '.html'), module_path
>>> with open(module_path + '.html') as html_file:
... html = html_file.read()
>>> import re
>>> assert re.search('<pre .*def.* .*mixed_test.*</pre>', html)
"""
def
mixed_test
():
"""docstring
"""
cdef
int
int1
,
int2
,
int3
cdef
char
*
ptr1
,
*
ptr2
=
"test"
,
*
ptr3
=
"toast"
int2
=
10
int3
=
20
obj1
=
1
obj2
=
2
obj3
=
3
int1
=
int2
+
int3
ptr1
=
ptr2
+
int3
ptr1
=
int2
+
ptr3
obj1
=
obj2
+
int3
return
int1
,
obj1
def
add_x_1
(
int
x
):
return
x
+
1
def
add_x_1f
(
x
):
return
x
+
1.0
def
add_x_large
(
x
):
return
x
+
2
**
30
def
add_1_x
(
x
):
return
1
+
x
def
add_1f_x
(
double
x
):
return
1.0
+
x
def
add_large_x
(
x
):
return
2
**
30
+
x
class
PythonClass
(
object
):
def
call
(
self
,
x
):
return
add_1_x
(
x
)
cdef
class
ExtensionType
(
object
):
@
classmethod
def
new
(
cls
):
return
cls
()
This diff is collapsed.
Click to expand it.
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