@@ -21,7 +21,11 @@ import _SwiftSyntaxTestSupport
21
21
22
22
public class EvaluateTests : XCTestCase {
23
23
func testLiterals( ) throws {
24
- let buildConfig = StaticBuildConfiguration ( customConditions: [ " DEBUG " , " ASSERTS " ] )
24
+ let buildConfig = StaticBuildConfiguration (
25
+ customConditions: [ " DEBUG " , " ASSERTS " ] ,
26
+ languageVersion: VersionTuple ( 6 ) ,
27
+ compilerVersion: VersionTuple ( 6 , 2 )
28
+ )
25
29
26
30
assertIfConfig ( " true " , . active, configuration: buildConfig)
27
31
assertIfConfig ( " false " , . inactive, configuration: buildConfig)
@@ -71,7 +75,11 @@ public class EvaluateTests: XCTestCase {
71
75
}
72
76
73
77
func testCustomConfigs( ) throws {
74
- let buildConfig = StaticBuildConfiguration ( customConditions: [ " DEBUG " , " ASSERTS " , " try " ] )
78
+ let buildConfig = StaticBuildConfiguration (
79
+ customConditions: [ " DEBUG " , " ASSERTS " , " try " ] ,
80
+ languageVersion: VersionTuple ( 6 ) ,
81
+ compilerVersion: VersionTuple ( 6 , 2 )
82
+ )
75
83
76
84
assertIfConfig ( " DEBUG " , . active, configuration: buildConfig)
77
85
assertIfConfig ( " NODEBUG " , . inactive, configuration: buildConfig)
@@ -136,7 +144,11 @@ public class EvaluateTests: XCTestCase {
136
144
}
137
145
138
146
func testBadExpressions( ) throws {
139
- let buildConfig = StaticBuildConfiguration ( customConditions: [ " DEBUG " , " ASSERTS " ] )
147
+ let buildConfig = StaticBuildConfiguration (
148
+ customConditions: [ " DEBUG " , " ASSERTS " ] ,
149
+ languageVersion: VersionTuple ( 6 ) ,
150
+ compilerVersion: VersionTuple ( 6 , 2 )
151
+ )
140
152
141
153
assertIfConfig (
142
154
" 3.14159 " ,
@@ -178,14 +190,22 @@ public class EvaluateTests: XCTestCase {
178
190
}
179
191
180
192
func testFeatures( ) throws {
181
- let buildConfig = StaticBuildConfiguration ( features: [ " ParameterPacks " ] )
193
+ let buildConfig = StaticBuildConfiguration (
194
+ features: [ " ParameterPacks " ] ,
195
+ languageVersion: VersionTuple ( 6 ) ,
196
+ compilerVersion: VersionTuple ( 6 , 2 )
197
+ )
182
198
183
199
assertIfConfig ( " hasFeature(ParameterPacks) " , . active, configuration: buildConfig)
184
200
assertIfConfig ( " hasFeature(HigherKindedGenerics) " , . inactive, configuration: buildConfig)
185
201
}
186
202
187
203
func testAttributes( ) throws {
188
- let buildConfig = StaticBuildConfiguration ( attributes: [ " available " ] )
204
+ let buildConfig = StaticBuildConfiguration (
205
+ attributes: [ " available " ] ,
206
+ languageVersion: VersionTuple ( 6 ) ,
207
+ compilerVersion: VersionTuple ( 6 , 2 )
208
+ )
189
209
190
210
assertIfConfig ( " hasAttribute(available) " , . active, configuration: buildConfig)
191
211
assertIfConfig ( " hasAttribute(unsafeUnavailable) " , . inactive, configuration: buildConfig)
@@ -533,7 +553,11 @@ public class EvaluateTests: XCTestCase {
533
553
assertIfConfig (
534
554
" defined(FOO) " ,
535
555
. active,
536
- configuration: StaticBuildConfiguration ( customConditions: [ " FOO " ] ) ,
556
+ configuration: StaticBuildConfiguration (
557
+ customConditions: [ " FOO " ] ,
558
+ languageVersion: VersionTuple ( 6 ) ,
559
+ compilerVersion: VersionTuple ( 6 , 2 )
560
+ ) ,
537
561
diagnostics: [
538
562
DiagnosticSpec (
539
563
message: message,
0 commit comments