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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
4fa6d965
Commit
4fa6d965
authored
Nov 26, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a couple more tests on builtin names
parent
367bcd79
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
tests/run/builtinnames.pyx
tests/run/builtinnames.pyx
+18
-0
No files found.
tests/run/builtinnames.pyx
View file @
4fa6d965
cimport
cython
def
test_file_py
(
file
):
def
test_file_py
(
file
):
assert
isinstance
(
file
,
(
str
,
unicode
)),
\
assert
isinstance
(
file
,
(
str
,
unicode
)),
\
u"not a string, found '%s' instead"
%
file
.
__class__
.
__name__
u"not a string, found '%s' instead"
%
file
.
__class__
.
__name__
...
@@ -12,19 +14,35 @@ cdef test_file_c(file):
...
@@ -12,19 +14,35 @@ cdef test_file_c(file):
def
range
(
arg
):
def
range
(
arg
):
return
u'range'
+
arg
return
u'range'
+
arg
def
len
(
arg
):
return
u'len'
+
arg
cdef
type
(
arg
):
cdef
type
(
arg
):
return
u'type'
+
arg
return
u'type'
+
arg
@
cython
.
test_fail_if_path_exists
(
'//SimpleCallNode/NameNode[@name="type" and @entry.is_cfunction]'
,
'//SimpleCallNode/NameNode[@name="len" and @entry.is_cfunction]'
,
)
@
cython
.
test_assert_path_exists
(
'//SimpleCallNode/NameNode[@name="type"]'
,
'//SimpleCallNode/NameNode[@name="type" and not(@entry.is_cfunction)]'
,
'//SimpleCallNode/NameNode[@name="len"]'
,
)
def
test_c
(
arg
):
def
test_c
(
arg
):
"""
"""
>>> test_c('abc')
>>> test_c('abc')
fileabc
fileabc
lenabc
typeabc
typeabc
>>> print(test_file_py('abc'))
>>> print(test_file_py('abc'))
abc
abc
>>> print(range('abc'))
>>> print(range('abc'))
rangeabc
rangeabc
>>> print(len('abc'))
lenabc
"""
"""
print
test_file_c
(
arg
)
print
test_file_c
(
arg
)
print
len
(
arg
)
print
type
(
arg
)
print
type
(
arg
)
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