File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
CodeGeneration/Tests/ValidateSyntaxNodes Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,33 @@ class ValidateSyntaxNodes: XCTestCase {
138
138
)
139
139
}
140
140
141
+ func testSyntaxCollectionsShouldEndWithList( ) {
142
+ var failures : [ ValidationFailure ] = [ ]
143
+
144
+ for node in SYNTAX_NODES . compactMap ( \. collectionNode) {
145
+ if !node. kind. syntaxType. description. hasSuffix ( " ListSyntax " ) {
146
+ failures. append (
147
+ ValidationFailure (
148
+ node: node. kind,
149
+ message: " is a collection but does not end with ListSyntax "
150
+ )
151
+ )
152
+ }
153
+ }
154
+
155
+ assertFailuresMatchXFails (
156
+ failures,
157
+ expectedFailures: [
158
+ ValidationFailure ( node: . documentationAttributeArguments, message: " is a collection but does not end with ListSyntax " ) ,
159
+ ValidationFailure ( node: . unexpectedNodes, message: " is a collection but does not end with ListSyntax " ) ,
160
+ ValidationFailure ( node: . effectsArguments, message: " is a collection but does not end with ListSyntax " ) ,
161
+ ValidationFailure ( node: . importPath, message: " is a collection but does not end with ListSyntax " ) ,
162
+ ValidationFailure ( node: . objCSelector, message: " is a collection but does not end with ListSyntax " ) ,
163
+ ValidationFailure ( node: . stringLiteralSegments, message: " is a collection but does not end with ListSyntax " ) ,
164
+ ]
165
+ )
166
+ }
167
+
141
168
/// Implementation detail of `testSingleTokenChoiceChildNaming`, validating a single child.
142
169
///
143
170
/// - Returns: A failure message if validation failed, otherwise `nil`
You can’t perform that action at this time.
0 commit comments