1try:
2    from utimeq import utimeq
3except ImportError:
4    print("SKIP")
5    raise SystemExit
6
7h = utimeq(10)
8
9# Check that for 2 same-key items, the queue is stable (pops items
10# in the same order they were pushed). Unfortunately, this no longer
11# holds for more same-key values, as the underlying heap structure
12# is not stable itself.
13h.push(100, 20, 0)
14h.push(100, 10, 0)
15
16res = [0, 0, 0]
17h.pop(res)
18assert res == [100, 20, 0]
19h.pop(res)
20assert res == [100, 10, 0]
21
22print("OK")
23