Unverified Commit eaa337f1 authored by Łukasz Langa's avatar Łukasz Langa Committed by GitHub
Browse files

Add more tests for fancy whitespace (#2147)

parent 557b54aa
Loading
Loading
Loading
Loading
+2 −0
Changes for CHANGES.md: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -6,6 +6,8 @@

- Fix crash on docstrings ending with "\ ". (#2142)

- Fix crash when atypical whitespace is cleaned out of dostrings (#2120)

- Reflect the `--skip-magic-trailing-comma` and `--experimental-string-processing` flags
  in the name of the cache file. Without this fix, changes in these flags would not take
  effect if the cache had already been populated. (#2131)
+28 −0
Changes for tests/data/docstring.py: 28 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -174,6 +174,20 @@ def multiline_backslash_2():
  hey there \ '''


def multiline_backslash_3():
  '''
  already escaped \\ '''


def my_god_its_full_of_stars_1():
    "I'm sorry Dave\u2001"


# the space below is actually a \u2001, removed in output
def my_god_its_full_of_stars_2():
    "I'm sorry Dave "


# output

class MyClass:
@@ -347,3 +361,17 @@ def multiline_backslash_1():
def multiline_backslash_2():
    """
    hey there \ """


def multiline_backslash_3():
    """
    already escaped \\"""


def my_god_its_full_of_stars_1():
    "I'm sorry Dave\u2001"


# the space below is actually a \u2001, removed in output
def my_god_its_full_of_stars_2():
    "I'm sorry Dave"
 No newline at end of file
+40 −0
Changes for tests/data/docstring_no_string_normalization.py: 40 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -102,6 +102,26 @@ def shockingly_the_quotes_are_normalized_v2():
    '''
    pass


def backslash_space():
    '\ '


def multiline_backslash_1():
  '''
  hey\there\
  \ '''


def multiline_backslash_2():
  '''
  hey there \ '''


def multiline_backslash_3():
  '''
  already escaped \\ '''

# output

class ALonelyClass:
@@ -207,3 +227,23 @@ def shockingly_the_quotes_are_normalized_v2():
    Docstring Docstring Docstring
    '''
    pass


def backslash_space():
    '\ '


def multiline_backslash_1():
    '''
  hey\there\
  \ '''


def multiline_backslash_2():
    '''
    hey there \ '''


def multiline_backslash_3():
    '''
    already escaped \\'''