self.check_roundtrip(r"f'\\\\N{{'")
self.check_roundtrip(r"f'\\\\\\N{{'")
self.check_roundtrip(r"f'\\\\\\\\N{{'")
+
+ self.check_roundtrip(r"f'\n{{foo}}'")
+ self.check_roundtrip(r"f'\\n{{foo}}'")
+ self.check_roundtrip(r"f'\\\n{{foo}}'")
+ self.check_roundtrip(r"f'\\\\n{{foo}}'")
+
+ self.check_roundtrip(r"f'\t{{foo}}'")
+ self.check_roundtrip(r"f'\\t{{foo}}'")
+ self.check_roundtrip(r"f'\\\t{{foo}}'")
+ self.check_roundtrip(r"f'\\\\t{{foo}}'")
+
+ self.check_roundtrip(r"rf'\t{{foo}}'")
+ self.check_roundtrip(r"rf'\\t{{foo}}'")
+ self.check_roundtrip(r"rf'\\\t{{foo}}'")
+ self.check_roundtrip(r"rf'\\\\t{{foo}}'")
+
+ self.check_roundtrip(r"rf'\{{foo}}'")
+ self.check_roundtrip(r"f'\\{{foo}}'")
+ self.check_roundtrip(r"rf'\\\{{foo}}'")
+ self.check_roundtrip(r"f'\\\\{{foo}}'")
cases = [
"""
if 1:
characters[-2::-1]
)
)
- if n_backslashes % 2 == 0:
+ if n_backslashes % 2 == 0 or characters[-1] != "N":
characters.append(character)
else:
consume_until_next_bracket = True