forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmultiline_errors.swift
108 lines (93 loc) · 4.32 KB
/
multiline_errors.swift
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// RUN: %target-typecheck-verify-swift
import Swift
// ===---------- Multiline --------===
// expecting at least 4 columns of leading indentation
_ = """
Eleven
Mu
""" // expected-error@-1{{insufficient indentation of line in multi-line string literal}}
// expected-note@-1{{should match space here}}
// expected-note@-3{{change indentation of this line to match closing delimiter}} {{3-3= }}
// expecting at least 4 columns of leading indentation
_ = """
Eleven
Mu
""" // expected-error@-1{{insufficient indentation of line in multi-line string literal}}
// expected-note@-1{{should match space here}}
// expected-note@-3{{change indentation of this line to match closing delimiter}} {{4-4= }}
// \t is not the same as an actual tab for de-indentation
_ = """
Twelve
\tNu
""" // expected-error@-1{{insufficient indentation of line in multi-line string literal}}
// expected-note@-1{{should match tab here}}
// expected-note@-3{{change indentation of this line to match closing delimiter}} {{1-1= }}
// a tab is not the same as multiple spaces for de-indentation
_ = """
Thirteen
Xi
""" // expected-error@-1{{unexpected tab in indentation of line in multi-line string literal}}
// expected-note@-1{{should match space here}}
// expected-note@-3{{change indentation of this line to match closing delimiter}} {{1-2= }}
// a tab is not the same as multiple spaces for de-indentation
_ = """
Fourteen
Pi
""" // expected-error@-1{{unexpected tab in indentation of line in multi-line string literal}}
// expected-note@-1{{should match space here}}
// expected-note@-3{{change indentation of this line to match closing delimiter}} {{3-4= }}
// multiple spaces are not the same as a tab for de-indentation
_ = """
Thirteen 2
Xi 2
""" // expected-error@-1{{unexpected space in indentation of line in multi-line string literal}}
// expected-note@-1{{should match tab here}}
// expected-note@-3{{change indentation of this line to match closing delimiter}} {{1-3= }}
// multiple spaces are not the same as a tab for de-indentation
_ = """
Fourteen 2
Pi 2
""" // expected-error@-1{{unexpected space in indentation of line in multi-line string literal}}
// expected-note@-1{{should match tab here}}
// expected-note@-3{{change indentation of this line to match closing delimiter}} {{2-4= }}
// newline currently required after opening """
_ = """Fourteen
Pi
""" // expected-error@-2{{multi-line string literal content must begin on a new line}} {{8-8=\n}}
// newline currently required before closing """
_ = """
Fourteen
Pi""" // expected-error@-0{{multi-line string literal closing delimiter must begin on a new line}} {{7-7=\n}}
// newline currently required after opening """
_ = """""" // expected-error@-0{{multi-line string literal content must begin on a new line}} {{8-8=\n}}
// newline currently required after opening """
_ = """ """ // expected-error@-0{{multi-line string literal content must begin on a new line}} {{8-8=\n}}
// two lines should get only one error
_ = """
Hello,
World!
""" // expected-error@-2{{unexpected space in indentation of next 2 lines in multi-line string literal}}
// expected-note@-1{{should match tab here}}
// expected-note@-4{{change indentation of these lines to match closing delimiter}} {{1-5= }} {{1-5= }}
_ = """
Zero A
Zero B
One A
One B
Two A
Two B
Three A
Three B
Four A
Four B
Five A
Five B
""" // expected-error@-12{{insufficient indentation of next 2 lines in multi-line string literal}}
// expected-note@-1{{should match tab here}}
// expected-note@-14{{change indentation of these lines to match closing delimiter}} {{1-1= }} {{1-1= }}
// expected-error@-13{{insufficient indentation of next 2 lines in multi-line string literal}}
// expected-note@-4{{should match tab here}}
// expected-note@-15{{change indentation of these lines to match closing delimiter}} {{2-2= }} {{2-2= }}
// expected-error@-14{{unexpected space in indentation of next 4 lines in multi-line string literal}}
// expected-note@-7{{should match tab here}}
// expected-note@-16{{change indentation of these lines to match closing delimiter}} {{1-1= }} {{1-1= }} {{1-1= }} {{1-1= }}