@@ -4,15 +4,15 @@ import XCTest
4
4
5
5
final class ForwardSlashRegexSkippingAllowedTests : XCTestCase {
6
6
func testForwardSlashRegexSkippingAllowed1( ) {
7
- AssertParse (
7
+ assertParse (
8
8
"""
9
9
// Make sure we can skip in all of the below cases.
10
10
"""
11
11
)
12
12
}
13
13
14
14
func testForwardSlashRegexSkippingAllowed2( ) {
15
- AssertParse (
15
+ assertParse (
16
16
#"""
17
17
// The printing implementation differs in asserts and no-asserts builds, it will
18
18
// either print `"Parse.NumFunctionsParsed" 0` or not print it at all. Make sure
@@ -23,54 +23,53 @@ final class ForwardSlashRegexSkippingAllowedTests: XCTestCase {
23
23
}
24
24
25
25
func testForwardSlashRegexSkippingAllowed3( ) {
26
- AssertParse (
26
+ assertParse (
27
27
"""
28
28
// Ensures there is a parse error
29
29
var 1️⃣: Int
30
30
""" ,
31
31
diagnostics: [
32
- // TODO: Old parser expected error on line 2: expected pattern
33
- DiagnosticSpec ( message: " expected pattern in variable " ) ,
32
+ DiagnosticSpec ( message: " expected pattern in variable " )
34
33
]
35
34
)
36
35
}
37
36
38
37
func testForwardSlashRegexSkippingAllowed4( ) {
39
- AssertParse (
38
+ assertParse (
40
39
"""
41
40
// Balanced `{}`, so okay.
42
41
func a() { 1️⃣/ {}/ }
43
42
""" ,
44
43
diagnostics: [
45
- DiagnosticSpec ( message: " unexpected code '/ {}/' in function " ) ,
44
+ DiagnosticSpec ( message: " unexpected code '/ {}/' in function " )
46
45
]
47
46
)
48
47
}
49
48
50
49
func testForwardSlashRegexSkippingAllowed5( ) {
51
- AssertParse (
50
+ assertParse (
52
51
#"""
53
52
func b() { 1️⃣/ \{}/ }
54
53
"""# ,
55
54
diagnostics: [
56
- DiagnosticSpec ( message: #"unexpected code '/ \{}/' in function"# ) ,
55
+ DiagnosticSpec ( message: #"unexpected code '/ \{}/' in function"# )
57
56
]
58
57
)
59
58
}
60
59
61
60
func testForwardSlashRegexSkippingAllowed6( ) {
62
- AssertParse (
61
+ assertParse (
63
62
#"""
64
63
func c() { 1️⃣/ {"{"}/ }
65
64
"""# ,
66
65
diagnostics: [
67
- DiagnosticSpec ( message: #"unexpected code '/ {"{"}/' in function"# ) ,
66
+ DiagnosticSpec ( message: #"unexpected code '/ {"{"}/' in function"# )
68
67
]
69
68
)
70
69
}
71
70
72
71
func testForwardSlashRegexSkippingAllowed7( ) {
73
- AssertParse (
72
+ assertParse (
74
73
"""
75
74
// Some cases of infix '/' that we should continue to skip.
76
75
func d() {
@@ -82,7 +81,7 @@ final class ForwardSlashRegexSkippingAllowedTests: XCTestCase {
82
81
}
83
82
84
83
func testForwardSlashRegexSkippingAllowed8( ) {
85
- AssertParse (
84
+ assertParse (
86
85
#"""
87
86
func e() {
88
87
let arr = [1, 2, 3]
@@ -95,7 +94,7 @@ final class ForwardSlashRegexSkippingAllowedTests: XCTestCase {
95
94
}
96
95
97
96
func testForwardSlashRegexSkippingAllowed9( ) {
98
- AssertParse (
97
+ assertParse (
99
98
"""
100
99
// Some cases of prefix '/' that we should continue to skip.
101
100
prefix operator /
@@ -105,7 +104,7 @@ final class ForwardSlashRegexSkippingAllowedTests: XCTestCase {
105
104
}
106
105
107
106
func testForwardSlashRegexSkippingAllowed10( ) {
108
- AssertParse (
107
+ assertParse (
109
108
"""
110
109
enum E {
111
110
case e
@@ -116,7 +115,7 @@ final class ForwardSlashRegexSkippingAllowedTests: XCTestCase {
116
115
}
117
116
118
117
func testForwardSlashRegexSkippingAllowed11( ) {
119
- AssertParse (
118
+ assertParse (
120
119
"""
121
120
func f() {
122
121
_ = /E.e
@@ -133,7 +132,7 @@ final class ForwardSlashRegexSkippingAllowedTests: XCTestCase {
133
132
}
134
133
135
134
func testForwardSlashRegexSkippingAllowed12( ) {
136
- AssertParse (
135
+ assertParse (
137
136
"""
138
137
postfix operator /
139
138
prefix func / <T> (_ x: T) -> T { x }
@@ -142,7 +141,7 @@ final class ForwardSlashRegexSkippingAllowedTests: XCTestCase {
142
141
}
143
142
144
143
func testForwardSlashRegexSkippingAllowed13( ) {
145
- AssertParse (
144
+ assertParse (
146
145
"""
147
146
// Some cases of postfix '/' that we should continue to skip.
148
147
func g() {
0 commit comments