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

Method test_prefixes

Lib/test/test_tokenize.py:3467–3483  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3465
3466
3467 def test_prefixes(self):
3468 # Get the list of defined string prefixes. I don't see an
3469 # obvious documented way of doing this, but probably the best
3470 # thing is to split apart tokenize.StringPrefix.
3471
3472 # Make sure StringPrefix begins and ends in parens. We're
3473 # assuming it's of the form "(a|b|ab)", if a, b, and cd are
3474 # valid string prefixes.
3475 self.assertEqual(tokenize.StringPrefix[0], '(')
3476 self.assertEqual(tokenize.StringPrefix[-1], ')')
3477
3478 # Then split apart everything else by '|'.
3479 defined_prefixes = set(tokenize.StringPrefix[1:-1].split('|'))
3480
3481 # Now compute the actual allowed string prefixes and compare
3482 # to what is defined in the tokenize module.
3483 self.assertEqual(defined_prefixes, self.determine_valid_prefixes())
3484
3485
3486if __name__ == "__main__":

Callers

nothing calls this directly

Calls 4

setFunction · 0.85
assertEqualMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected