Skip to content

Commit cac1e52

Browse files
Update irbuild-str.test
1 parent 6dbd6bb commit cac1e52

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

mypyc/test-data/irbuild-str.test

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,3 +504,22 @@ L0:
504504
r7 = CPyStr_Strip(s, 0)
505505
r8 = CPyStr_RStrip(s, 0)
506506
return 1
507+
508+
[case testCountAll]
509+
def do_count(s: str) -> int:
510+
return s.count("x")
511+
[out]
512+
def do_count(s):
513+
s, r0 :: str
514+
r0 = 'x'
515+
return CPyStr_CountAll(s, r0)
516+
517+
[case testCountStartEnd]
518+
def do_count(s: str, start: int, end: int) -> int:
519+
return s.count("x", start, end)
520+
[out]
521+
def do_count(s, start, end):
522+
s, r0 :: str
523+
start, end :: Py_ssize_t
524+
r0 = 'x'
525+
return PyUnicode_Count(s, r0, start, end)

0 commit comments

Comments
 (0)