@@ -1926,30 +1926,30 @@ def testfunc(n):
19261926 self .assertNotIn ("_GUARD_TOS_INT" , uops )
19271927
19281928 def test_get_len (self ):
1929- def testfunc1 (n ):
1930- x = 0
1929+ def testfunc (n ):
1930+ x = ""
19311931 for _ in range (n ):
19321932 match (1 , 2 , 3 , 4 ):
19331933 case [_, _, _, _]:
1934- x += 1
1934+ x += "1"
19351935 return x
1936- res , ex = self ._run_with_optimizer (testfunc1 , TIER2_THRESHOLD )
1937- self .assertEqual (res , TIER2_THRESHOLD )
1936+ res , ex = self ._run_with_optimizer (testfunc , TIER2_THRESHOLD )
1937+ self .assertEqual (len ( res ) , TIER2_THRESHOLD )
19381938 uops = get_opnames (ex )
1939- self .assertNotIn ("_GUARD_TOS_INT " , uops )
1939+ self .assertNotIn ("_GUARD_NOS_INT " , uops )
19401940 self .assertIn ("_GET_LEN" , uops )
19411941 self .assertIn ("_POP_TOP_LOAD_CONST_INLINE_BORROW" , uops )
1942- def testfunc1 (n ):
1943- x = 0
1942+ def testfunc (n ):
1943+ x = ""
19441944 for _ in range (n ):
19451945 match [1 , 2 , 3 , 4 ]:
19461946 case [_, _, _, _]:
1947- x += 1
1947+ x += "1"
19481948 return x
1949- res , ex = self ._run_with_optimizer (testfunc1 , TIER2_THRESHOLD )
1950- self .assertEqual (res , TIER2_THRESHOLD )
1949+ res , ex = self ._run_with_optimizer (testfunc , TIER2_THRESHOLD )
1950+ self .assertEqual (len ( res ) , TIER2_THRESHOLD )
19511951 uops = get_opnames (ex )
1952- self .assertNotIn ("_GUARD_TOS_INT " , uops )
1952+ self .assertNotIn ("_GUARD_NOS_INT " , uops )
19531953 self .assertIn ("_GET_LEN" , uops )
19541954 self .assertNotIn ("_POP_TOP_LOAD_CONST_INLINE_BORROW" , uops )
19551955
0 commit comments