MCPcopy Index your code
hub / github.com/python/cpython / test_rfind

Method test_rfind

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

Source from the content-addressed store, hash-verified

722 b.find, index)
723
724 def test_rfind(self):
725 b = self.type2test(b'mississippi')
726 i = 105
727 w = 119
728
729 self.assertEqual(b.rfind(b'ss'), 5)
730 self.assertEqual(b.rfind(b'w'), -1)
731 self.assertEqual(b.rfind(b'mississippian'), -1)
732
733 self.assertEqual(b.rfind(i), 10)
734 self.assertEqual(b.rfind(w), -1)
735
736 self.assertEqual(b.rfind(b'ss', 3), 5)
737 self.assertEqual(b.rfind(b'ss', 0, 6), 2)
738
739 self.assertEqual(b.rfind(i, 1, 3), 1)
740 self.assertEqual(b.rfind(i, 3, 9), 7)
741 self.assertEqual(b.rfind(w, 1, 3), -1)
742
743 def test_index(self):
744 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