MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_rfind

Method test_rfind

Lib/test/test_bigmem.py:289–302  ·  view source on GitHub ↗
(self, size)

Source from the content-addressed store, hash-verified

287
288 @bigmemtest(size=_2G, memuse=2)
289 def test_rfind(self, size):
290 _ = self.from_latin1
291 SUBSTR = _(' abc def ghi')
292 sublen = len(SUBSTR)
293 s = _('').join([SUBSTR, _('-') * size, SUBSTR])
294 self.assertEqual(s.rfind(_(' ')), sublen + size + SUBSTR.rfind(_(' ')))
295 self.assertEqual(s.rfind(SUBSTR), sublen + size)
296 self.assertEqual(s.rfind(_(' '), 0, size), SUBSTR.rfind(_(' ')))
297 self.assertEqual(s.rfind(SUBSTR, 0, sublen + size), 0)
298 self.assertEqual(s.rfind(_('i')), sublen + size + SUBSTR.rfind(_('i')))
299 self.assertEqual(s.rfind(_('i'), 0, sublen), SUBSTR.rfind(_('i')))
300 self.assertEqual(s.rfind(_('i'), 0, sublen + size),
301 SUBSTR.rfind(_('i')))
302 self.assertEqual(s.rfind(_('j')), -1)
303
304 @bigmemtest(size=_2G, memuse=2)
305 def test_rindex(self, size):

Callers

nothing calls this directly

Calls 5

lenFunction · 0.85
_Function · 0.70
joinMethod · 0.45
assertEqualMethod · 0.45
rfindMethod · 0.45

Tested by

no test coverage detected