forked from Mirror/wren
Add raw string literals
Also document + test multi line literals.
This commit is contained in:
@ -3,3 +3,28 @@ System.print("a string") // expect: a string
|
||||
|
||||
// Non-ASCII.
|
||||
System.print("A~¶Þॐஃ") // expect: A~¶Þॐஃ
|
||||
|
||||
// Raw strings.
|
||||
System.print("""A raw string""") // expect: A raw string
|
||||
|
||||
var long = "
|
||||
A
|
||||
multi line
|
||||
regular string
|
||||
"
|
||||
System.print(long) // expect:
|
||||
// expect: A
|
||||
// expect: multi line
|
||||
// expect: regular string
|
||||
// expect:
|
||||
|
||||
var raw = """
|
||||
A if*(<invalid>)*
|
||||
multi line /{}()
|
||||
raw string [\]/
|
||||
"json": "value"
|
||||
"""
|
||||
System.print(raw) // expect: A if*(<invalid>)*
|
||||
// expect: multi line /{}()
|
||||
// expect: raw string [\]/
|
||||
// expect: "json": "value"
|
||||
2
test/language/string/unterminated_raw.wren
Normal file
2
test/language/string/unterminated_raw.wren
Normal file
@ -0,0 +1,2 @@
|
||||
// expect error line 2
|
||||
"""this string has no close quote
|
||||
Reference in New Issue
Block a user