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 @@ -129,6 +129,33 @@ class ValidateSyntaxNodes: XCTestCase {
129
129
)
130
130
}
131
131
132
+ func testSyntaxCollectionsShouldEndWithList( ) {
133
+ var failures : [ ValidationFailure ] = [ ]
134
+
135
+ for node in SYNTAX_NODES . compactMap ( \. collectionNode) {
136
+ if !node. kind. syntaxType. description. hasSuffix ( " ListSyntax " ) {
137
+ failures. append (
138
+ ValidationFailure (
139
+ node: node. kind,
140
+ message: " is a collection but does not end with ListSyntax "
141
+ )
142
+ )
143
+ }
144
+ }
145
+
146
+ assertFailuresMatchXFails (
147
+ failures,
148
+ expectedFailures: [
149
+ ValidationFailure ( node: . documentationAttributeArguments, message: " is a collection but does not end with ListSyntax " ) ,
150
+ ValidationFailure ( node: . unexpectedNodes, message: " is a collection but does not end with ListSyntax " ) ,
151
+ ValidationFailure ( node: . effectsArguments, message: " is a collection but does not end with ListSyntax " ) ,
152
+ ValidationFailure ( node: . importPath, message: " is a collection but does not end with ListSyntax " ) ,
153
+ ValidationFailure ( node: . objCSelector, message: " is a collection but does not end with ListSyntax " ) ,
154
+ ValidationFailure ( node: . stringLiteralSegments, message: " is a collection but does not end with ListSyntax " ) ,
155
+ ]
156
+ )
157
+ }
158
+
132
159
/// Implementation detail of `testSingleTokenChoiceChildNaming`, validating a single child.
133
160
///
134
161
/// - Returns: A failure message if validation failed, otherwise `nil`
You can’t perform that action at this time.
0 commit comments