mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Adds support for multiline string literals to appear inside of string interpolations. Tests added.
52 lines
1.4 KiB
Swift
52 lines
1.4 KiB
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
import Swift
|
|
|
|
// ===---------- Multiline --------===
|
|
|
|
_ = """
|
|
Eleven
|
|
Mu
|
|
""" // expected-error@-1{{invalid mix of multi-line string literal indentation}}
|
|
// expecting at least 4 columns of leading indentation
|
|
|
|
_ = """
|
|
Eleven
|
|
Mu
|
|
""" // expected-error@-1{{invalid mix of multi-line string literal indentation}}
|
|
// expecting at least 4 columns of leading indentation
|
|
|
|
_ = """
|
|
Twelve
|
|
\tNu
|
|
""" // expected-error@-1{{invalid mix of multi-line string literal indentation}}
|
|
// \t is not the same as an actual tab for de-indentation
|
|
|
|
_ = """
|
|
Thirteen
|
|
Xi
|
|
""" // expected-error@-1{{invalid mix of multi-line string literal indentation}}
|
|
// a tab is not the same as multiple spaces for de-indentation
|
|
|
|
_ = """
|
|
Fourteen
|
|
Pi
|
|
""" // expected-error@-1{{invalid mix of multi-line string literal indentation}}
|
|
// a tab is not the same as multiple spaces for de-indentation
|
|
|
|
_ = """Fourteen
|
|
Pi
|
|
""" // expected-error@-2{{invalid start of multi-line string literal}}
|
|
// newline currently required after opening """
|
|
|
|
_ = """
|
|
Fourteen
|
|
Pi""" // expected-error@-0{{invalid end of multi-line string literal}}
|
|
// newline currently required before closing """
|
|
|
|
_ = """""" // expected-error@-0{{invalid start of multi-line string literal}}
|
|
// newline currently required after opening """
|
|
|
|
_ = """ """ // expected-error@-0{{invalid start of multi-line string literal}}
|
|
// newline currently required after opening """
|