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

Method test_rfind

Lib/test/test_bytes.py:650–667  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

648 b.find, index)
649
650 def test_rfind(self):
651 b = self.type2test(b'mississippi')
652 i = 105
653 w = 119
654
655 self.assertEqual(b.rfind(b'ss'), 5)
656 self.assertEqual(b.rfind(b'w'), -1)
657 self.assertEqual(b.rfind(b'mississippian'), -1)
658
659 self.assertEqual(b.rfind(i), 10)
660 self.assertEqual(b.rfind(w), -1)
661
662 self.assertEqual(b.rfind(b'ss', 3), 5)
663 self.assertEqual(b.rfind(b'ss', 0, 6), 2)
664
665 self.assertEqual(b.rfind(i, 1, 3), 1)
666 self.assertEqual(b.rfind(i, 3, 9), 7)
667 self.assertEqual(b.rfind(w, 1, 3), -1)
668
669 def test_index(self):
670 b = self.type2test(b'mississippi')

Callers

nothing calls this directly

Calls 3

type2testMethod · 0.80
assertEqualMethod · 0.45
rfindMethod · 0.45

Tested by

no test coverage detected