Skip to content

Commit be3dfca

Browse files
committed
add more tests
1 parent a77f224 commit be3dfca

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Lib/test/test_peepholer.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,6 +1441,19 @@ def test_fold_constant_intrinsic_list_to_tuple(self):
14411441
]
14421442
self.cfg_optimization_test(before, after, consts=[], expected_consts=[(1, 2, 3)])
14431443

1444+
# no sequence start
1445+
same = [
1446+
('LOAD_SMALL_INT', 1, 0),
1447+
('LIST_APPEND', 1, 0),
1448+
('LOAD_SMALL_INT', 2, 0),
1449+
('LIST_APPEND', 1, 0),
1450+
('LOAD_SMALL_INT', 3, 0),
1451+
('LIST_APPEND', 1, 0),
1452+
('CALL_INTRINSIC_1', INTRINSIC_LIST_TO_TUPLE, 0),
1453+
('RETURN_VALUE', None, 0)
1454+
]
1455+
self.cfg_optimization_test(same, same, consts=[])
1456+
14441457
def test_optimize_if_const_list(self):
14451458
before = [
14461459
('NOP', None, 0),

0 commit comments

Comments
 (0)