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
Kirill Smelkov
cython
Commits
332bc801
Commit
332bc801
authored
Aug 26, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for #1790.
parent
2cfc7267
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
tests/run/cpp_stl_string_ascii_auto_encoding.pyx
tests/run/cpp_stl_string_ascii_auto_encoding.pyx
+15
-2
No files found.
tests/run/cpp_stl_string_ascii_auto_encoding.pyx
View file @
332bc801
...
@@ -2,9 +2,8 @@
...
@@ -2,9 +2,8 @@
# tag: cpp, werror
# tag: cpp, werror
# cython: c_string_encoding=ascii, c_string_type=unicode
# cython: c_string_encoding=ascii, c_string_type=unicode
cimport
cython
from
libcpp.string
cimport
string
from
libcpp.string
cimport
string
from
libcpp.vector
cimport
vector
b_asdf
=
b'asdf'
b_asdf
=
b'asdf'
s_asdf
=
'asdf'
s_asdf
=
'asdf'
...
@@ -148,3 +147,17 @@ def test_str_cast(a):
...
@@ -148,3 +147,17 @@ def test_str_cast(a):
cdef
string
s
=
a
cdef
string
s
=
a
assert
s
.
length
()
==
<
size_t
>
len
(
a
),
"%d != %d"
%
(
s
.
length
(),
len
(
a
))
assert
s
.
length
()
==
<
size_t
>
len
(
a
),
"%d != %d"
%
(
s
.
length
(),
len
(
a
))
return
<
str
>
s
return
<
str
>
s
def
test_vector_of_strings
(
*
strings
):
"""
>>> results = test_vector_of_strings(b_asdf, u_asdf)
>>> results == [u_asdf, u_asdf] or results
True
>>> type(results[0]) is type(u_asdf) or type(results[0])
True
>>> type(results[1]) is type(u_asdf) or type(results[1])
True
"""
cdef
vector
[
string
]
v
=
strings
return
v
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