]> git.madduck.net Git - etc/vim.git/blob - tests/data/string_quotes.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

3384241f4adaf7ad8e1dbff5be6da70e32a40558
[etc/vim.git] / tests / data / string_quotes.py
1 ''''''
2 '\''
3 '"'
4 "'"
5 "\""
6 "Hello"
7 "Don't do that"
8 'Here is a "'
9 'What\'s the deal here?'
10 "What's the deal \"here\"?"
11 "And \"here\"?"
12 """Strings with "" in them"""
13 '''Strings with "" in them'''
14 '''Here's a "'''
15 '''Here's a " '''
16 '''Just a normal triple
17 quote'''
18 f"just a normal {f} string"
19 f'''This is a triple-quoted {f}-string'''
20 f'MOAR {" ".join([])}'
21 f"MOAR {' '.join([])}"
22 r"raw string ftw"
23 r'Date d\'expiration:(.*)'
24 r'Tricky "quote'
25 r'Not-so-tricky \"quote'
26 rf'{yay}'
27 '\n\
28 The \"quick\"\n\
29 brown fox\n\
30 jumps over\n\
31 the \'lazy\' dog.\n\
32 '
33 re.compile(r'[\\"]')
34 "x = ''; y = \"\""
35 "x = '''; y = \"\""
36 "x = ''''; y = \"\""
37 "x = '' ''; y = \"\""
38 "x = ''; y = \"\"\""
39 "x = '''; y = \"\"\"\""
40 "x = ''''; y = \"\"\"\"\""
41 "x = '' ''; y = \"\"\"\"\""
42 'unnecessary \"\"escaping'
43 "unnecessary \'\'escaping"
44 '\\""'
45 "\\''"
46 'Lots of \\\\\\\\\'quotes\''
47 f'{y * " "} \'{z}\''
48 f'{{y * " "}} \'{z}\''
49 f'\'{z}\' {y * " "}'
50 f'{y * x} \'{z}\''
51 '\'{z}\' {y * " "}'
52 '{y * x} \'{z}\''
53
54 # We must bail out if changing the quotes would introduce backslashes in f-string
55 # expressions. xref: https://github.com/psf/black/issues/2348
56 f"\"{b}\"{' ' * (long-len(b)+1)}: \"{sts}\",\n"
57 f"\"{a}\"{'hello' * b}\"{c}\""
58
59 # output
60
61 """"""
62 "'"
63 '"'
64 "'"
65 '"'
66 "Hello"
67 "Don't do that"
68 'Here is a "'
69 "What's the deal here?"
70 'What\'s the deal "here"?'
71 'And "here"?'
72 """Strings with "" in them"""
73 """Strings with "" in them"""
74 '''Here's a "'''
75 """Here's a " """
76 """Just a normal triple
77 quote"""
78 f"just a normal {f} string"
79 f"""This is a triple-quoted {f}-string"""
80 f'MOAR {" ".join([])}'
81 f"MOAR {' '.join([])}"
82 r"raw string ftw"
83 r"Date d\'expiration:(.*)"
84 r'Tricky "quote'
85 r"Not-so-tricky \"quote"
86 rf"{yay}"
87 "\nThe \"quick\"\nbrown fox\njumps over\nthe 'lazy' dog.\n"
88 re.compile(r'[\\"]')
89 "x = ''; y = \"\""
90 "x = '''; y = \"\""
91 "x = ''''; y = \"\""
92 "x = '' ''; y = \"\""
93 'x = \'\'; y = """'
94 'x = \'\'\'; y = """"'
95 'x = \'\'\'\'; y = """""'
96 'x = \'\' \'\'; y = """""'
97 'unnecessary ""escaping'
98 "unnecessary ''escaping"
99 '\\""'
100 "\\''"
101 "Lots of \\\\\\\\'quotes'"
102 f'{y * " "} \'{z}\''
103 f"{{y * \" \"}} '{z}'"
104 f'\'{z}\' {y * " "}'
105 f"{y * x} '{z}'"
106 "'{z}' {y * \" \"}"
107 "{y * x} '{z}'"
108
109 # We must bail out if changing the quotes would introduce backslashes in f-string
110 # expressions. xref: https://github.com/psf/black/issues/2348
111 f"\"{b}\"{' ' * (long-len(b)+1)}: \"{sts}\",\n"
112 f"\"{a}\"{'hello' * b}\"{c}\""