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

Method test_find

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

Source from the content-addressed store, hash-verified

128
129 @bigmemtest(size=_2G, memuse=2)
130 def test_find(self, size):
131 _ = self.from_latin1
132 SUBSTR = _(' abc def ghi')
133 sublen = len(SUBSTR)
134 s = _('').join([SUBSTR, _('-') * size, SUBSTR])
135 self.assertEqual(s.find(_(' ')), 0)
136 self.assertEqual(s.find(SUBSTR), 0)
137 self.assertEqual(s.find(_(' '), sublen), sublen + size)
138 self.assertEqual(s.find(SUBSTR, len(SUBSTR)), sublen + size)
139 self.assertEqual(s.find(_('i')), SUBSTR.find(_('i')))
140 self.assertEqual(s.find(_('i'), sublen),
141 sublen + size + SUBSTR.find(_('i')))
142 self.assertEqual(s.find(_('i'), size),
143 sublen + size + SUBSTR.find(_('i')))
144 self.assertEqual(s.find(_('j')), -1)
145
146 @bigmemtest(size=_2G, memuse=2)
147 def test_index(self, size):

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected