Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
492c612f
Commit
492c612f
authored
Dec 24, 2016
by
Paul Sokolovsky
Browse files
tests/utimeq_stable: Test for partial stability of utimeq queuing.
parent
7327966d
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/extmod/utimeq_stable.py
0 → 100644
View file @
492c612f
try
:
from
utimeq
import
utimeq
except
ImportError
:
print
(
"SKIP"
)
import
sys
sys
.
exit
()
h
=
utimeq
(
10
)
# Check that for 2 same-key items, the queue is stable (pops items
# in the same order they were pushed). Unfortunately, this no longer
# holds for more same-key values, as the underlying heap structure
# is not stable itself.
h
.
push
(
100
,
20
,
0
)
h
.
push
(
100
,
10
,
0
)
res
=
[
0
,
0
,
0
]
h
.
pop
(
res
)
assert
res
==
[
100
,
20
,
0
]
h
.
pop
(
res
)
assert
res
==
[
100
,
10
,
0
]
print
(
"OK"
)
tests/extmod/utimeq_stable.py.exp
0 → 100644
View file @
492c612f
OK
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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