Skip to content

Commit 1662b47

Browse files
committed
Fix review idea
Signed-off-by: Manjusaka <[email protected]>
1 parent f2f71d9 commit 1662b47

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Lib/test/test_capi/test_opt.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -1927,14 +1927,16 @@ def testfunc(n):
19271927

19281928
def test_get_len(self):
19291929
def testfunc(n):
1930+
x = 0
19301931
a = [1, 2, 3, 4]
19311932
for _ in range(n):
19321933
match a:
1933-
case [1,2]:
1934-
_ = len(a) - 1
1935-
_, ex = self._run_with_optimizer(testfunc, TIER2_THRESHOLD)
1934+
case [_, _, _, _]:
1935+
x += 1
1936+
return x
1937+
res, ex = self._run_with_optimizer(testfunc, TIER2_THRESHOLD)
1938+
self.assertEqual(res, TIER2_THRESHOLD)
19361939
uops = get_opnames(ex)
1937-
self.assertNotIn("_GUARD_NOS_INT", uops)
19381940
self.assertNotIn("_GUARD_TOS_INT", uops)
19391941
self.assertIn("_GET_LEN", uops)
19401942

0 commit comments

Comments
 (0)