Skip to content

Commit 73b0aa7

Browse files
committed
Fix missing @run on indirect subclass query
1 parent a1cfe78 commit 73b0aa7

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

languages/swift/runnables.scm

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -107,25 +107,21 @@
107107
;; This pattern allows users to mark indirect subclasses (MyTests <- MyTestsBase <- XCTestCase)
108108
;; by adding a "// @XCTestClass" comment before the class declaration.
109109
(
110-
(source_file
111-
(comment) @_marker (#match? @_marker ".*@XCTestClass.*")
112-
(class_declaration
113-
name: (type_identifier) @SWIFT_TEST_CLASS
114-
)
110+
(comment) @_marker (#match? @_marker ".*@XCTestClass.*")
111+
(class_declaration
112+
name: (type_identifier) @SWIFT_TEST_CLASS @run
115113
) @_swift-xctest-class
116114
(#set! tag swift-xctest-class)
117115
)
118116

119117
;; Test function within comment-annotated XCTest class
120118
(
121-
(source_file
122-
(comment) @_marker (#match? @_marker ".*@XCTestClass.*")
123-
(class_declaration
124-
name: (type_identifier) @SWIFT_TEST_CLASS
125-
body: (class_body
126-
(function_declaration
127-
name: (simple_identifier) @_name @SWIFT_TEST_FUNC @run (#match? @run "^test")
128-
)
119+
(comment) @_marker (#match? @_marker ".*@XCTestClass.*")
120+
(class_declaration
121+
name: (type_identifier) @SWIFT_TEST_CLASS
122+
body: (class_body
123+
(function_declaration
124+
name: (simple_identifier) @_name @SWIFT_TEST_FUNC @run (#match? @run "^test")
129125
)
130126
)
131127
) @_swift-xctest-func

0 commit comments

Comments
 (0)