MCPcopy Create free account
hub / github.com/python/cpython / test_star_indices_locations

Method test_star_indices_locations

Lib/test/test_fnmatch.py:307–316  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

305 self.assertEqual(translated, expect, pattern)
306
307 def test_star_indices_locations(self):
308 from fnmatch import _translate
309
310 blocks = ['a^b', '***', '?', '?', '[a-z]', '[1-9]', '*', '++', '[[a']
311 parts, star_indices = _translate(''.join(blocks), '*', '.')
312 expect_parts = ['a', r'\^', 'b', '*',
313 '.', '.', '[a-z]', '[1-9]', '*',
314 r'\+', r'\+', r'\[', r'\[', 'a']
315 self.assertListEqual(parts, expect_parts)
316 self.assertListEqual(star_indices, [3, 8])
317
318
319class FilterTestCase(unittest.TestCase):

Callers

nothing calls this directly

Calls 3

_translateFunction · 0.90
assertListEqualMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected