X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/80bd2b3134b4f01da4e279d040a224326b3577e5..21c8dc85f5fa6ca70b028027a03588e12f532636:/tests/string_quotes.py diff --git a/tests/string_quotes.py b/tests/string_quotes.py index 1080aaf..1ac6b06 100644 --- a/tests/string_quotes.py +++ b/tests/string_quotes.py @@ -1,3 +1,7 @@ +'\'' +'"' +"'" +"\"" "Hello" "Don't do that" 'Here is a "' @@ -15,9 +19,36 @@ f'''This is a triple-quoted {f}-string''' f'MOAR {" ".join([])}' f"MOAR {' '.join([])}" r"raw string ftw" +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\ +' +re.compile(r'[\\"]') +"x = ''; y = \"\"" +"x = '''; y = \"\"" +"x = ''''; y = \"\"" +"x = '' ''; y = \"\"" +"x = ''; y = \"\"\"" +"x = '''; y = \"\"\"\"" +"x = ''''; y = \"\"\"\"\"" +"x = '' ''; y = \"\"\"\"\"" +'unnecessary \"\"escaping' +"unnecessary \'\'escaping" +'\\""' +"\\''" # output +"'" +'"' +"'" +'"' "Hello" "Don't do that" 'Here is a "' @@ -35,3 +66,26 @@ f"""This is a triple-quoted {f}-string""" f'MOAR {" ".join([])}' f"MOAR {' '.join([])}" r"raw string ftw" +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\ +" +re.compile(r'[\\"]') +"x = ''; y = \"\"" +"x = '''; y = \"\"" +"x = ''''; y = \"\"" +"x = '' ''; y = \"\"" +'x = \'\'; y = """' +'x = \'\'\'; y = """"' +'x = \'\'\'\'; y = """""' +'x = \'\' \'\'; y = """""' +'unnecessary ""escaping' +"unnecessary ''escaping" +'\\""' +"\\''"