string_feature.test
1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
""
"foo\"b\\ar"
"f''o'o'\"bar"
"foo
bar"
"foo ${ 42 } baz"
"foo \${ 42 } baz"
''''
''
foo
bar
''
''
f'oo'''ba'r
foo ${ 42 } baz
foo ''${ 42 } baz
''
----------------------------------------------------
[
["string", ["\"\""]],
["string", ["\"foo\\\"b\\\\ar\""]],
["string", ["\"f''o'o'\\\"bar\""]],
["string", ["\"foo\r\nbar\""]],
["string", [
"\"foo ",
["interpolation", [
["antiquotation", "$"],
["punctuation", "{"],
["number", "42"],
["punctuation", "}"]
]],
" baz\""
]],
["string", ["\"foo \\${ 42 } baz\""]],
["string", ["''''"]],
["string", ["''\r\nfoo\r\nbar\r\n''"]],
["string", [
"''\r\nf'oo'''ba'r\r\nfoo ",
["interpolation", [
["antiquotation", "$"],
["punctuation", "{"],
["number", "42"],
["punctuation", "}"]
]],
" baz\r\nfoo ''${ 42 } baz\r\n''"
]]
]
----------------------------------------------------
Checks for strings and string interpolation.
Also checks that escaped interpolations are not interpreted.