@@ -108,32 +108,32 @@ final class StringInterpolationTests: XCTestCase {
108
108
}
109
109
110
110
func testInterpolationLiteralString( ) {
111
- let a : SourceFileSyntax = " print( \( literal: " Hello, world! " ) ) "
111
+ let a : ExprSyntax = " print( \( literal: " Hello, world! " ) ) "
112
112
AssertStringsEqualWithDiff ( a. description, #"print("Hello, world!")"# )
113
113
114
- let b : SourceFileSyntax = " print( \( literal: " \" Hello \" , world! " ) ) "
114
+ let b : ExprSyntax = " print( \( literal: " \" Hello \" , world! " ) ) "
115
115
AssertStringsEqualWithDiff ( b. description, ##"print(#""Hello", world!"#)"## )
116
116
117
- let c : SourceFileSyntax = " print( \( literal: " Hello \\ # \\ world! " ) ) "
117
+ let c : ExprSyntax = " print( \( literal: " Hello \\ # \\ world! " ) ) "
118
118
AssertStringsEqualWithDiff ( c. description, ###"print(##"Hello\#\world!"##)"### )
119
119
120
- let d : SourceFileSyntax = " print( \( literal: " Hello, world! \n " ) ) "
120
+ let d : ExprSyntax = " print( \( literal: " Hello, world! \n " ) ) "
121
121
AssertStringsEqualWithDiff ( d. description, #"print("Hello, world!\n")"# )
122
122
123
- let e : SourceFileSyntax = " print( \( literal: " \" Hello \" , world! \n " ) ) "
123
+ let e : ExprSyntax = " print( \( literal: " \" Hello \" , world! \n " ) ) "
124
124
AssertStringsEqualWithDiff ( e. description, ##"print(#""Hello", world!\#n"#)"## )
125
125
}
126
126
127
127
func testInterpolationLiteralInt( ) {
128
128
func test< T: ExpressibleByIntegerLiteral & ExpressibleByLiteralSyntax > ( with ty: T . Type , unsigned: Bool = false ) {
129
- let a : SourceFileSyntax = " print( \( literal: 42 as T ) ) "
129
+ let a : ExprSyntax = " print( \( literal: 42 as T ) ) "
130
130
AssertStringsEqualWithDiff ( a. description, #"print(42)"# , additionalInfo: String ( describing: ty) )
131
131
132
- let b : SourceFileSyntax = " print( \( literal: 0 as T ) ) "
132
+ let b : ExprSyntax = " print( \( literal: 0 as T ) ) "
133
133
AssertStringsEqualWithDiff ( b. description, #"print(0)"# , additionalInfo: String ( describing: ty) )
134
134
135
135
if !unsigned {
136
- let c : SourceFileSyntax = " print( \( literal: - 42 as T ) ) "
136
+ let c : ExprSyntax = " print( \( literal: - 42 as T ) ) "
137
137
AssertStringsEqualWithDiff ( c. description, ##"print(-42)"## , additionalInfo: String ( describing: ty) )
138
138
}
139
139
}
@@ -152,28 +152,28 @@ final class StringInterpolationTests: XCTestCase {
152
152
153
153
func testInterpolationLiteralFloat( ) {
154
154
func test< T: FloatingPoint & ExpressibleByFloatLiteral & ExpressibleByLiteralSyntax > ( with ty: T . Type ) {
155
- let a : SourceFileSyntax = " print( \( literal: 3.14 as T ) ) "
155
+ let a : ExprSyntax = " print( \( literal: 3.14 as T ) ) "
156
156
AssertStringsEqualWithDiff ( a. description, #"print(3.14)"# , additionalInfo: String ( describing: ty) )
157
157
158
- let b : SourceFileSyntax = " print( \( literal: 0 as T ) ) "
158
+ let b : ExprSyntax = " print( \( literal: 0 as T ) ) "
159
159
AssertStringsEqualWithDiff ( b. description, #"print(0.0)"# , additionalInfo: String ( describing: ty) )
160
160
161
- let c : SourceFileSyntax = " print( \( literal: - 42 as T ) ) "
161
+ let c : ExprSyntax = " print( \( literal: - 42 as T ) ) "
162
162
AssertStringsEqualWithDiff ( c. description, ##"print(-42.0)"## , additionalInfo: String ( describing: ty) )
163
163
164
- let d : SourceFileSyntax = " print( \( literal: T . infinity) ) "
164
+ let d : ExprSyntax = " print( \( literal: T . infinity) ) "
165
165
AssertStringsEqualWithDiff ( d. description, ##"print(.infinity)"## , additionalInfo: String ( describing: ty) )
166
166
167
- let e : SourceFileSyntax = " print( \( literal: - T. infinity) ) "
167
+ let e : ExprSyntax = " print( \( literal: - T. infinity) ) "
168
168
AssertStringsEqualWithDiff ( e. description, ##"print(-.infinity)"## , additionalInfo: String ( describing: ty) )
169
169
170
- let f : SourceFileSyntax = " print( \( literal: T . nan) ) "
170
+ let f : ExprSyntax = " print( \( literal: T . nan) ) "
171
171
AssertStringsEqualWithDiff ( f. description, ##"print(.nan)"## , additionalInfo: String ( describing: ty) )
172
172
173
- let g : SourceFileSyntax = " print( \( literal: T . signalingNaN) ) "
173
+ let g : ExprSyntax = " print( \( literal: T . signalingNaN) ) "
174
174
AssertStringsEqualWithDiff ( g. description, ##"print(.signalingNaN)"## , additionalInfo: String ( describing: ty) )
175
175
176
- let h : SourceFileSyntax = " print( \( literal: - 0.0 as T ) ) "
176
+ let h : ExprSyntax = " print( \( literal: - 0.0 as T ) ) "
177
177
AssertStringsEqualWithDiff ( h. description, ##"print(-0.0)"## , additionalInfo: String ( describing: ty) )
178
178
}
179
179
@@ -182,24 +182,24 @@ final class StringInterpolationTests: XCTestCase {
182
182
}
183
183
184
184
func testInterpolationLiteralBool( ) {
185
- let a : SourceFileSyntax = " print( \( literal: true ) ) "
185
+ let a : ExprSyntax = " print( \( literal: true ) ) "
186
186
AssertStringsEqualWithDiff ( a. description, #"print(true)"# )
187
187
188
- let b : SourceFileSyntax = " print( \( literal: false ) ) "
188
+ let b : ExprSyntax = " print( \( literal: false ) ) "
189
189
AssertStringsEqualWithDiff ( b. description, #"print(false)"# )
190
190
}
191
191
192
192
func testInterpolationLiteralCollections( ) {
193
- let a : SourceFileSyntax = " print( \( literal: [ 3 , 2 , 1 ] ) ) "
193
+ let a : ExprSyntax = " print( \( literal: [ 3 , 2 , 1 ] ) ) "
194
194
AssertStringsEqualWithDiff ( a. description, #"print([3, 2, 1])"# )
195
195
196
- let b : SourceFileSyntax = " print( \( literal: [ 3 , 2 , 1 ] as Set ) ) "
196
+ let b : ExprSyntax = " print( \( literal: [ 3 , 2 , 1 ] as Set ) ) "
197
197
AssertStringsEqualWithDiff ( b. description, #"print([1, 2, 3])"# )
198
198
199
- let c : SourceFileSyntax = " print( \( literal: [ 3 : " three " , 2 : " two " , 1 : " one " ] as KeyValuePairs ) ) "
199
+ let c : ExprSyntax = " print( \( literal: [ 3 : " three " , 2 : " two " , 1 : " one " ] as KeyValuePairs ) ) "
200
200
AssertStringsEqualWithDiff ( c. description, #"print([3: "three", 2: "two", 1: "one"])"# )
201
201
202
- let d : SourceFileSyntax = " print( \( literal: [ 3 : " three " , 2 : " two " , 1 : " one " ] ) ) "
202
+ let d : ExprSyntax = " print( \( literal: [ 3 : " three " , 2 : " two " , 1 : " one " ] ) ) "
203
203
AssertStringsEqualWithDiff ( d. description, #"print([1: "one", 2: "two", 3: "three"])"# )
204
204
}
205
205
0 commit comments