Skip to content

Commit

Permalink
Line numbers for multiline string test
Browse files Browse the repository at this point in the history
  • Loading branch information
akaihola committed Apr 5, 2022
1 parent 4686e78 commit 0f9a8a2
Showing 1 changed file with 57 additions and 55 deletions.
112 changes: 57 additions & 55 deletions src/darker/tests/test_multiline_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,61 +9,63 @@
def test_get_multiline_string_ranges():
"""`get_multiline_string_ranges()` identifies multi-line strings correctly"""
content = TextDocument.from_lines(
[
"'single-quoted string'", # (line 1)
"f'single-quoted f-string'",
"r'single-quoted raw string'",
"rf'single-quoted raw f-string'",
"b'single-quoted bytestring'", # (line 5)
"rb'single-quoted raw bytestring'",
"'''triple-single-quoted one-line string'''",
"f'''triple-single-quoted one-line f-string'''",
"r'''triple-single-quoted one-line raw string'''",
"rf'''triple-single-quoted one-line raw f-string'''", # (line 10)
"b'''triple-single-quoted one-line bytestring'''",
"rb'''triple-single-quoted one-line raw bytestring'''",
"'''triple-single-quoted", # line 13
" two-line string'''",
"f'''triple-single-quoted", # line 15
" two-line f-string'''",
"r'''triple-single-quoted", # line 17
" two-line raw string'''",
"rf'''triple-single-quoted", # line 19
" two-line raw f-string'''",
"b'''triple-single-quoted", # line 21
" two-line bytestring'''",
"rb'''triple-single-quoted", # line 23
" two-line raw bytestring'''",
'"double-quoted string"', # (line 25)
'f"double-quoted f-string"',
'r"double-quoted raw string"',
'rf"double-quoted raw f-string"',
'b"double-quoted bytestring"',
'rb"double-quoted raw bytestring"', # (line 30)
'"""triple-double-quoted one-line string"""',
'f"""triple-double-quoted one-line f-string"""',
'r"""triple-double-quoted one-line raw string"""',
'rf"""triple-double-quoted one-line raw f-string"""',
'b"""triple-double-quoted one-line bytestring"""', # (line 35)
'rb"""triple-double-quoted one-line raw bytestring"""',
'"""triple-double-quoted', # line 37
' two-line string"""',
'f"""triple-double-quoted', # line 39
' two-line f-string"""',
'r"""triple-double-quoted', # line 41
' two-line raw string"""',
'rf"""triple-double-quoted', # line 43
' two-line raw f-string"""',
'b"""triple-double-quoted', # line 45
' two-line bytestring"""',
'rb"""triple-double-quoted', # line 47
' two-line raw bytestring"""',
'"""triple-', # line 49
" double-",
" quoted",
" six-",
" line",
' string"""', # line 54
line
for _, line in [
# Dummy line numbers added to ease debugging of failures
(1, "'single-quoted string'"),
(2, "f'single-quoted f-string'"),
(3, "r'single-quoted raw string'"),
(4, "rf'single-quoted raw f-string'"),
(5, "b'single-quoted bytestring'"),
(6, "rb'single-quoted raw bytestring'"),
(7, "'''triple-single-quoted one-line string'''"),
(8, "f'''triple-single-quoted one-line f-string'''"),
(9, "r'''triple-single-quoted one-line raw string'''"),
(10, "rf'''triple-single-quoted one-line raw f-string'''"),
(11, "b'''triple-single-quoted one-line bytestring'''"),
(12, "rb'''triple-single-quoted one-line raw bytestring'''"),
(13, "'''triple-single-quoted"),
(14, " two-line string'''"),
(15, "f'''triple-single-quoted"),
(16, " two-line f-string'''"),
(17, "r'''triple-single-quoted"),
(18, " two-line raw string'''"),
(19, "rf'''triple-single-quoted"),
(20, " two-line raw f-string'''"),
(21, "b'''triple-single-quoted"),
(22, " two-line bytestring'''"),
(23, "rb'''triple-single-quoted"),
(24, " two-line raw bytestring'''"),
(25, '"double-quoted string"'),
(26, 'f"double-quoted f-string"'),
(27, 'r"double-quoted raw string"'),
(28, 'rf"double-quoted raw f-string"'),
(29, 'b"double-quoted bytestring"'),
(30, 'rb"double-quoted raw bytestring"'),
(31, '"""triple-double-quoted one-line string"""'),
(32, 'f"""triple-double-quoted one-line f-string"""'),
(33, 'r"""triple-double-quoted one-line raw string"""'),
(34, 'rf"""triple-double-quoted one-line raw f-string"""'),
(35, 'b"""triple-double-quoted one-line bytestring"""'),
(36, 'rb"""triple-double-quoted one-line raw bytestring"""'),
(37, '"""triple-double-quoted'),
(38, ' two-line string"""'),
(39, 'f"""triple-double-quoted'),
(40, ' two-line f-string"""'),
(41, 'r"""triple-double-quoted'),
(42, ' two-line raw string"""'),
(43, 'rf"""triple-double-quoted'),
(44, ' two-line raw f-string"""'),
(45, 'b"""triple-double-quoted'),
(46, ' two-line bytestring"""'),
(47, 'rb"""triple-double-quoted'),
(48, ' two-line raw bytestring"""'),
(49, '"""triple-'),
(50, " double-"),
(51, " quoted"),
(52, " six-"),
(53, " line"),
(54, ' string"""'),
]
)

Expand Down

0 comments on commit 0f9a8a2

Please sign in to comment.