Skip to content

Commit 9888120

Browse files
committed
Fix typo in NavigatorIndexTests
1 parent 13085aa commit 9888120

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

Tests/SwiftDocCTests/Indexing/NavigatorIndexTests.swift

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import XCTest
1414
typealias Node = NavigatorTree.Node
1515
typealias PageType = NavigatorIndex.PageType
1616

17-
let testBundleIndetifier = "org.swift.docc.example"
17+
let testBundleIdentifier = "org.swift.docc.example"
1818

1919
class NavigatorIndexingTests: XCTestCase {
2020

@@ -177,7 +177,7 @@ Root
177177

178178
let original = NavigatorTree(root: root)
179179
try original.write(to: indexURL)
180-
let readTree = try NavigatorTree.read(from: indexURL, bundleIdentifier: testBundleIndetifier, interfaceLanguages: [.swift], atomically: true)
180+
let readTree = try NavigatorTree.read(from: indexURL, bundleIdentifier: testBundleIdentifier, interfaceLanguages: [.swift], atomically: true)
181181

182182
XCTAssertEqual(original.root.countItems(), readTree.root.countItems())
183183
XCTAssertTrue(compare(lhs: original.root, rhs: readTree.root))
@@ -198,7 +198,7 @@ Root
198198
XCTAssertTrue(validateTree(node: readTree.root, validator: bundleIdentifierValidator), "The tree has bundle identifier missing.")
199199
XCTAssertTrue(validateTree(node: readTree.root, validator: emptyPresentationIdentifierValidator), "The tree has a presentation identifier set which should not be present.")
200200

201-
var treeWithPresentationIdentifier = try NavigatorTree.read(from: indexURL, bundleIdentifier: testBundleIndetifier, interfaceLanguages: [.swift], atomically: true, presentationIdentifier: "com.example.test")
201+
var treeWithPresentationIdentifier = try NavigatorTree.read(from: indexURL, bundleIdentifier: testBundleIdentifier, interfaceLanguages: [.swift], atomically: true, presentationIdentifier: "com.example.test")
202202

203203
let presentationIdentifierValidator: (NavigatorTree.Node) -> Bool = { node in
204204
return node.presentationIdentifier == "com.example.test"
@@ -209,7 +209,7 @@ Root
209209
XCTAssertTrue(validateTree(node: treeWithPresentationIdentifier.root, validator: presentationIdentifierValidator), "The tree lacks the presentation identifier.")
210210

211211
// Test non-atomic read.
212-
treeWithPresentationIdentifier = try NavigatorTree.read(from: indexURL, bundleIdentifier: testBundleIndetifier, interfaceLanguages: [.swift], atomically: false, presentationIdentifier: "com.example.test")
212+
treeWithPresentationIdentifier = try NavigatorTree.read(from: indexURL, bundleIdentifier: testBundleIdentifier, interfaceLanguages: [.swift], atomically: false, presentationIdentifier: "com.example.test")
213213

214214
XCTAssertTrue(validateTree(node: treeWithPresentationIdentifier.root, validator: idValidator), "The tree has IDs missing.")
215215
XCTAssertTrue(validateTree(node: treeWithPresentationIdentifier.root, validator: bundleIdentifierValidator), "The tree has bundle identifier missing.")
@@ -290,7 +290,7 @@ Root
290290
try? FileManager.default.removeItem(at: targetURL)
291291
}
292292

293-
let builder = NavigatorIndex.Builder(outputURL: targetURL, bundleIdentifier: testBundleIndetifier)
293+
let builder = NavigatorIndex.Builder(outputURL: targetURL, bundleIdentifier: testBundleIdentifier)
294294
builder.setup()
295295
builder.finalize()
296296

@@ -347,7 +347,7 @@ Root
347347
try? FileManager.default.removeItem(at: targetURL)
348348
}
349349

350-
let builder = NavigatorIndex.Builder(outputURL: targetURL, bundleIdentifier: testBundleIndetifier)
350+
let builder = NavigatorIndex.Builder(outputURL: targetURL, bundleIdentifier: testBundleIdentifier)
351351
builder.setup()
352352
try builder.index(renderNode: renderNode)
353353
builder.finalize()
@@ -365,7 +365,7 @@ Root
365365
// Create an index 10 times to ensure we have not undeterministic behavior across builds
366366
for _ in 0..<10 {
367367
let targetURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(UUID().uuidString)
368-
let builder = NavigatorIndex.Builder(outputURL: targetURL, bundleIdentifier: testBundleIndetifier, sortRootChildrenByName: true)
368+
let builder = NavigatorIndex.Builder(outputURL: targetURL, bundleIdentifier: testBundleIdentifier, sortRootChildrenByName: true)
369369
builder.setup()
370370

371371
for identifier in context.knownPages {
@@ -389,7 +389,7 @@ Root
389389
XCTAssertEqual(Set(navigatorIndex.languages), Set(["Swift"]))
390390
XCTAssertEqual(navigatorIndex.navigatorTree.root.countItems(), navigatorIndex.navigatorTree.numericIdentifierToNode.count)
391391
XCTAssertTrue(validateTree(node: navigatorIndex.navigatorTree.root, validator: { (node) -> Bool in
392-
return node.bundleIdentifier == testBundleIndetifier
392+
return node.bundleIdentifier == testBundleIdentifier
393393
}))
394394

395395
let allNodes = navigatorIndex.navigatorTree.numericIdentifierToNode.values
@@ -411,7 +411,7 @@ Root
411411
let jsonData = try Data(contentsOf: jsonFile)
412412

413413
let targetURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(UUID().uuidString)
414-
let builder = NavigatorIndex.Builder(outputURL: targetURL, bundleIdentifier: testBundleIndetifier, sortRootChildrenByName: true, groupByLanguage: true)
414+
let builder = NavigatorIndex.Builder(outputURL: targetURL, bundleIdentifier: testBundleIdentifier, sortRootChildrenByName: true, groupByLanguage: true)
415415
builder.setup()
416416

417417
let renderNode = try XCTUnwrap(RenderJSONDecoder.makeDecoder().decode(RenderNode.self, from: jsonData))
@@ -447,7 +447,7 @@ Root
447447
// Create an index 10 times to ensure we have not undeterministic behavior across builds
448448
for _ in 0..<10 {
449449
let targetURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(UUID().uuidString)
450-
let builder = NavigatorIndex.Builder(outputURL: targetURL, bundleIdentifier: testBundleIndetifier, sortRootChildrenByName: true, usePageTitle: true)
450+
let builder = NavigatorIndex.Builder(outputURL: targetURL, bundleIdentifier: testBundleIdentifier, sortRootChildrenByName: true, usePageTitle: true)
451451
builder.setup()
452452

453453
for identifier in context.knownPages {
@@ -471,7 +471,7 @@ Root
471471
XCTAssertEqual(Set(navigatorIndex.languages), Set(["Swift"]))
472472
XCTAssertEqual(navigatorIndex.navigatorTree.root.countItems(), navigatorIndex.navigatorTree.numericIdentifierToNode.count)
473473
XCTAssertTrue(validateTree(node: navigatorIndex.navigatorTree.root, validator: { (node) -> Bool in
474-
return node.bundleIdentifier == testBundleIndetifier
474+
return node.bundleIdentifier == testBundleIdentifier
475475
}))
476476

477477
let allNodes = navigatorIndex.navigatorTree.numericIdentifierToNode.values
@@ -496,7 +496,7 @@ Root
496496
// Create an index 10 times to ensure we have not undeterministic behavior across builds
497497
for _ in 0..<10 {
498498
let targetURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(UUID().uuidString)
499-
let builder = NavigatorIndex.Builder(outputURL: targetURL, bundleIdentifier: testBundleIndetifier, sortRootChildrenByName: true, writePathsOnDisk: false)
499+
let builder = NavigatorIndex.Builder(outputURL: targetURL, bundleIdentifier: testBundleIdentifier, sortRootChildrenByName: true, writePathsOnDisk: false)
500500
builder.setup()
501501

502502
for identifier in context.knownPages {
@@ -521,7 +521,7 @@ Root
521521
XCTAssertEqual(Set(navigatorIndex.languages), Set(["Swift"]))
522522
XCTAssertEqual(navigatorIndex.navigatorTree.root.countItems(), navigatorIndex.navigatorTree.numericIdentifierToNode.count)
523523
XCTAssertTrue(validateTree(node: navigatorIndex.navigatorTree.root, validator: { (node) -> Bool in
524-
return node.bundleIdentifier == testBundleIndetifier
524+
return node.bundleIdentifier == testBundleIdentifier
525525
}))
526526

527527
let allNodes = navigatorIndex.navigatorTree.numericIdentifierToNode.values
@@ -551,7 +551,7 @@ Root
551551
let converter = DocumentationContextConverter(bundle: bundle, context: context, renderContext: renderContext)
552552

553553
let targetURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(UUID().uuidString)
554-
let builder = NavigatorIndex.Builder(outputURL: targetURL, bundleIdentifier: testBundleIndetifier, sortRootChildrenByName: true, groupByLanguage: true)
554+
let builder = NavigatorIndex.Builder(outputURL: targetURL, bundleIdentifier: testBundleIdentifier, sortRootChildrenByName: true, groupByLanguage: true)
555555
builder.setup()
556556

557557
for identifier in context.knownPages {
@@ -602,7 +602,7 @@ Root
602602
// Create an index 10 times to ensure we have no undeterministic behavior across builds
603603
for _ in 0..<10 {
604604
let targetURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(UUID().uuidString)
605-
let builder = NavigatorIndex.Builder(outputURL: targetURL, bundleIdentifier: testBundleIndetifier, sortRootChildrenByName: true)
605+
let builder = NavigatorIndex.Builder(outputURL: targetURL, bundleIdentifier: testBundleIdentifier, sortRootChildrenByName: true)
606606
builder.setup()
607607

608608
for identifier in context.knownPages {
@@ -663,7 +663,7 @@ Root
663663
let converter = DocumentationContextConverter(bundle: bundle, context: context, renderContext: renderContext)
664664

665665
let targetURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(UUID().uuidString)
666-
let builder = NavigatorIndex.Builder(outputURL: targetURL, bundleIdentifier: testBundleIndetifier, sortRootChildrenByName: true)
666+
let builder = NavigatorIndex.Builder(outputURL: targetURL, bundleIdentifier: testBundleIdentifier, sortRootChildrenByName: true)
667667
builder.setup()
668668

669669
for identifier in context.knownPages {
@@ -678,7 +678,7 @@ Root
678678
let navigatorIndex = try NavigatorIndex(url: targetURL)
679679

680680
XCTAssertEqual(navigatorIndex.pathHasher, .md5)
681-
XCTAssertEqual(navigatorIndex.bundleIdentifier, testBundleIndetifier)
681+
XCTAssertEqual(navigatorIndex.bundleIdentifier, testBundleIdentifier)
682682
XCTAssertEqual(navigatorIndex.availabilityIndex.platforms, [.watchOS, .iOS, .macCatalyst, .tvOS, .macOS])
683683
XCTAssertEqual(navigatorIndex.availabilityIndex.versions(for: .macOS), Set([
684684
Platform.Version(string: "10.9")!,
@@ -762,7 +762,7 @@ Root
762762
let converter = DocumentationContextConverter(bundle: bundle, context: context, renderContext: renderContext)
763763

764764
let targetURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(UUID().uuidString)
765-
let builder = NavigatorIndex.Builder(outputURL: targetURL, bundleIdentifier: testBundleIndetifier, sortRootChildrenByName: true)
765+
let builder = NavigatorIndex.Builder(outputURL: targetURL, bundleIdentifier: testBundleIdentifier, sortRootChildrenByName: true)
766766
builder.setup()
767767

768768
// Change the path hasher to the FNV-1 implementation and make sure paths and mappings are still working.

0 commit comments

Comments
 (0)