stress_phystoken.tok 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
  2. # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
  3. # Here's some random Python so that test_tokenize_myself will have some
  4. # stressful stuff to try. This file is .tok instead of .py so pylint won't
  5. # complain about it, check_eol won't look at it, etc.
  6. first_back = """\
  7. hey there!
  8. """
  9. other_back = """
  10. hey \
  11. there
  12. """
  13. lots_of_back = """\
  14. hey \
  15. there
  16. """
  17. # This next line is supposed to have trailing whitespace:
  18. fake_back = """\
  19. ouch
  20. """
  21. # Lots of difficulty happens with code like:
  22. #
  23. # fake_back = """\
  24. # ouch
  25. # """
  26. #
  27. # Ugh, the edge cases...
  28. # What about a comment like this\
  29. "what's this string doing here?"
  30. class C(object):
  31. def there():
  32. this = 5 + \
  33. 7
  34. that = \
  35. "a continued line"
  36. cont1 = "one line of text" + \
  37. "another line of text"
  38. a_long_string = \
  39. "part 1" \
  40. "2" \
  41. "3 is longer"
  42. def hello():
  43. print("Hello world!")
  44. hello()