Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
PyPy
pypy
Commits
b5edc5d9a857
Commit
db460883
authored
Jun 19, 2020
by
Yannick Jadoul
Browse files
Convert most of pypy/module/struct/test/test_struct.py to new-style apptest_ tests
--HG-- branch : py3.7
parent
1e937435a7d2
Pipeline
#7078
passed with stage
in 4 minutes and 39 seconds
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
pypy/module/struct/test/apptest_struct.py
0 → 100644
View file @
b5edc5d9
This diff is collapsed.
Click to expand it.
pypy/module/struct/test/apptest_structbuffer.py
0 → 100644
View file @
b5edc5d9
"""
Tests for the struct module implemented at interp-level in pypy/module/struct.
"""
# spaceconfig = {"usemodules": ["struct", "__pypy__"]}
import
struct
from
__pypy__
import
bytebuffer
def
test_pack_into
():
b
=
bytebuffer
(
19
)
sz
=
struct
.
calcsize
(
"ii"
)
struct
.
pack_into
(
"ii"
,
b
,
2
,
17
,
42
)
assert
b
[:]
==
(
b
'
\x00
'
*
2
+
struct
.
pack
(
"ii"
,
17
,
42
)
+
b
'
\x00
'
*
(
19
-
sz
-
2
))
m
=
memoryview
(
b
)
struct
.
pack_into
(
"ii"
,
m
,
2
,
17
,
42
)
def
test_unpack_from
():
b
=
bytebuffer
(
19
)
sz
=
struct
.
calcsize
(
"ii"
)
b
[
2
:
2
+
sz
]
=
struct
.
pack
(
"ii"
,
17
,
42
)
assert
struct
.
unpack_from
(
"ii"
,
b
,
2
)
==
(
17
,
42
)
b
[:
sz
]
=
struct
.
pack
(
"ii"
,
18
,
43
)
assert
struct
.
unpack_from
(
"ii"
,
b
)
==
(
18
,
43
)
\ No newline at end of file
pypy/module/struct/test/test_struct.py
View file @
b5edc5d9
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