diff --git a/tests/basics/deque1.py b/tests/basics/deque1.py index ee51516b5c..6b5669c45e 100644 --- a/tests/basics/deque1.py +++ b/tests/basics/deque1.py @@ -45,3 +45,18 @@ try: d.popleft() except IndexError: print("IndexError") + +# Case where get index wraps around when appending to full deque +d = deque((), 2) +d.append(1) +d.append(2) +d.append(3) +d.append(4) +d.append(5) +print(d.popleft(), d.popleft()) + +# Unsupported unary op +try: + ~d +except TypeError: + print("TypeError") diff --git a/tests/basics/sys_getsizeof.py b/tests/basics/sys_getsizeof.py index d16eb1561a..fe1b403e04 100644 --- a/tests/basics/sys_getsizeof.py +++ b/tests/basics/sys_getsizeof.py @@ -13,3 +13,10 @@ print(sys.getsizeof({1: 2}) >= 2) class A: pass print(sys.getsizeof(A()) > 0) + +# Only test deque if we have it +try: + from ucollections import deque + assert sys.getsizeof(deque((), 1)) > 0 +except ImportError: + pass