@@ -163,13 +163,18 @@ class DocumentationCuratorTests: XCTestCase {
163
163
""" . write ( to: url. appendingPathComponent ( " Root.md " ) , atomically: true , encoding: . utf8)
164
164
}
165
165
166
- var crawler = DocumentationCurator . init ( in: context, bundle: bundle)
166
+ let crawler = DocumentationCurator . init ( in: context, bundle: bundle)
167
167
XCTAssert ( context. problems. isEmpty, " Expected no problems. Found: \( context. problems. map ( \. diagnostic. summary) ) " )
168
168
169
- for node in context. rootModules {
170
- XCTAssertNoThrow ( try crawler. crawlChildren ( of: node, prepareForCuration: { _ in } , relateNodes: { _, _ in } ) )
169
+ guard let moduleNode = context. nodeWithSymbolIdentifier ( " SourceLocations " ) ,
170
+ let pathToRoot = context. pathsTo ( moduleNode. reference) . first,
171
+ let root = pathToRoot. first else {
172
+
173
+ XCTFail ( " Module doesn't have technology root as a predecessor in its path " )
174
+ return
171
175
}
172
176
177
+ XCTAssertEqual ( root. path, " /documentation/Root " )
173
178
XCTAssertEqual ( crawler. problems. count, 0 )
174
179
175
180
}
@@ -202,12 +207,9 @@ class DocumentationCuratorTests: XCTestCase {
202
207
""" . write ( to: url. appendingPathComponent ( " Ancestor.md " ) , atomically: true , encoding: . utf8)
203
208
}
204
209
205
- let crawler = DocumentationCurator . init ( in: context, bundle: bundle)
210
+ let _ = DocumentationCurator . init ( in: context, bundle: bundle)
206
211
XCTAssert ( context. problems. isEmpty, " Expected no problems. Found: \( context. problems. map ( \. diagnostic. summary) ) " )
207
212
208
-
209
-
210
-
211
213
guard let moduleNode = context. nodeWithSymbolIdentifier ( " SourceLocations " ) ,
212
214
let pathToRoot = context. pathsTo ( moduleNode. reference) . first,
213
215
let root = pathToRoot. first else {
0 commit comments