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
084d880e
Commit
084d880e
authored
Mar 31, 2018
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test for fstring conversion of unsigned C integers.
parent
e00f9c27
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
tests/run/fstring.pyx
tests/run/fstring.pyx
+20
-0
No files found.
tests/run/fstring.pyx
View file @
084d880e
...
...
@@ -140,6 +140,26 @@ def format_c_numbers(signed char c, short s, int n, long l, float f, double d):
return
s1
,
s2
,
s3
,
s4
def
format_c_numbers_unsigned
(
unsigned
char
c
,
unsigned
short
s
,
unsigned
int
n
,
unsigned
long
l
):
"""
>>> s1, s2, s3 = format_c_numbers_unsigned(123, 135, 12, 12312312)
>>> print(s1)
123 135 5675737012
>>> print(s2)
12f
>>> print(s3)
0C014 bbdef8
"""
s1
=
f"
{
c
}{
s
:
4
}
{
l
:
o
}{
n
}
"
assert
isinstance
(
s1
,
unicode
),
type
(
s1
)
s2
=
f"
{
n
:
-
4
}
f"
assert
isinstance
(
s2
,
unicode
),
type
(
s2
)
s3
=
f"
{
n
:
02
X
}{
n
:
03
o
}{
l
:
10
x
}
"
assert
isinstance
(
s3
,
unicode
),
type
(
s3
)
return
s1
,
s2
,
s3
@
cython
.
test_fail_if_path_exists
(
"//CoerceToPyTypeNode"
,
)
...
...
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