Skip to content

Commit 760aa09

Browse files
tomlogicdpgeorge
authored andcommitted
tests/basics/lexer: Add line continuation tests for lexer.
Tests for an issue with line continuation failing in paste mode due to the lexer only checking for \n in the "following" character position, before next_char() has had a chance to convert \r and \r\n to \n.
1 parent 6f56412 commit 760aa09

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

tests/basics/lexer.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@
2727
print(eval("12\r"))
2828
print(eval("123\r"))
2929

30+
# line continuation
31+
print(eval("'123' \\\r '456'"))
32+
print(eval("'123' \\\n '456'"))
33+
print(eval("'123' \\\r\n '456'"))
34+
print(eval("'123'\\\r'456'"))
35+
print(eval("'123'\\\n'456'"))
36+
print(eval("'123'\\\r\n'456'"))
37+
3038
# backslash used to escape a line-break in a string
3139
print('a\
3240
b')

0 commit comments

Comments
 (0)