Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add more tests
  • Loading branch information
WolframAlph committed Mar 18, 2025
commit 836c0ee500d58c1e6509320756a66f62690b03a5
13 changes: 13 additions & 0 deletions Lib/test/test_peepholer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,19 @@ def test_fold_constant_intrinsic_list_to_tuple(self):
]
self.cfg_optimization_test(before, after, consts=[], expected_consts=[(1, 2, 3)])

# no sequence start
same = [
('LOAD_SMALL_INT', 1, 0),
('LIST_APPEND', 1, 0),
('LOAD_SMALL_INT', 2, 0),
('LIST_APPEND', 1, 0),
('LOAD_SMALL_INT', 3, 0),
('LIST_APPEND', 1, 0),
('CALL_INTRINSIC_1', INTRINSIC_LIST_TO_TUPLE, 0),
('RETURN_VALUE', None, 0)
]
self.cfg_optimization_test(same, same, consts=[])

def test_optimize_if_const_list(self):
before = [
('NOP', None, 0),
Expand Down