Add test for removing indents in multiline strings

This commit is contained in:
Joshua Warner 2022-07-20 19:20:10 -07:00
parent a1512dfd79
commit 61b1ab059a
3 changed files with 112 additions and 0 deletions

View File

@ -0,0 +1,102 @@
Defs(
Defs {
tags: [
Index(2147483648),
Index(2147483649),
Index(2147483650),
],
regions: [
@0-22,
@23-49,
@50-92,
],
space_before: [
Slice(start = 0, length = 0),
Slice(start = 0, length = 1),
Slice(start = 1, length = 1),
],
space_after: [
Slice(start = 0, length = 0),
Slice(start = 1, length = 0),
Slice(start = 2, length = 0),
],
spaces: [
Newline,
Newline,
],
type_defs: [],
value_defs: [
Body(
@0-1 Identifier(
"a",
),
@4-22 Str(
Line(
[
Plaintext(
"Hello,",
),
EscapedChar(
Newline,
),
EscapedChar(
Newline,
),
Plaintext(
"World!",
),
],
),
),
),
Body(
@23-24 Identifier(
"b",
),
@27-49 Str(
Block(
[
[
Plaintext(
"Hello,",
),
EscapedChar(
Newline,
),
EscapedChar(
Newline,
),
Plaintext(
"World!",
),
],
],
),
),
),
Body(
@50-51 Identifier(
"c",
),
@58-92 SpaceBefore(
Str(
PlainLine(
"\n Hello,\n\n World!\n ",
),
),
[
Newline,
],
),
),
],
},
@93-95 SpaceBefore(
Num(
"42",
),
[
Newline,
],
),
)

View File

@ -0,0 +1,9 @@
a = "Hello,\n\nWorld!"
b = """Hello,\n\nWorld!"""
c =
"""
Hello,
World!
"""
42

View File

@ -204,6 +204,7 @@ mod test_parse {
pass/not_docs.expr,
pass/number_literal_suffixes.expr,
pass/one_backpassing.expr,
pass/multiline_string.expr,
pass/one_char_string.expr,
pass/one_def.expr,
pass/one_minus_two.expr,