X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/7f3678885fc7ab6f9fb1749f6d2a8ed3468841f3..8c04847aa22d14f01bb206cfc1b1e1cebd2ae538:/tests/data/string_quotes.py?ds=sidebyside diff --git a/tests/data/string_quotes.py b/tests/data/string_quotes.py index 807f866..3384241 100644 --- a/tests/data/string_quotes.py +++ b/tests/data/string_quotes.py @@ -43,6 +43,18 @@ re.compile(r'[\\"]') "unnecessary \'\'escaping" '\\""' "\\''" +'Lots of \\\\\\\\\'quotes\'' +f'{y * " "} \'{z}\'' +f'{{y * " "}} \'{z}\'' +f'\'{z}\' {y * " "}' +f'{y * x} \'{z}\'' +'\'{z}\' {y * " "}' +'{y * x} \'{z}\'' + +# We must bail out if changing the quotes would introduce backslashes in f-string +# expressions. xref: https://github.com/psf/black/issues/2348 +f"\"{b}\"{' ' * (long-len(b)+1)}: \"{sts}\",\n" +f"\"{a}\"{'hello' * b}\"{c}\"" # output @@ -72,12 +84,7 @@ r"Date d\'expiration:(.*)" r'Tricky "quote' r"Not-so-tricky \"quote" rf"{yay}" -"\n\ -The \"quick\"\n\ -brown fox\n\ -jumps over\n\ -the 'lazy' dog.\n\ -" +"\nThe \"quick\"\nbrown fox\njumps over\nthe 'lazy' dog.\n" re.compile(r'[\\"]') "x = ''; y = \"\"" "x = '''; y = \"\"" @@ -91,3 +98,15 @@ re.compile(r'[\\"]') "unnecessary ''escaping" '\\""' "\\''" +"Lots of \\\\\\\\'quotes'" +f'{y * " "} \'{z}\'' +f"{{y * \" \"}} '{z}'" +f'\'{z}\' {y * " "}' +f"{y * x} '{z}'" +"'{z}' {y * \" \"}" +"{y * x} '{z}'" + +# We must bail out if changing the quotes would introduce backslashes in f-string +# expressions. xref: https://github.com/psf/black/issues/2348 +f"\"{b}\"{' ' * (long-len(b)+1)}: \"{sts}\",\n" +f"\"{a}\"{'hello' * b}\"{c}\""