Skip to content

Commit a6c744f

Browse files
update AutomaticCuration test to loop over upstream symbol kinds
1 parent 6a1fbbd commit a6c744f

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Sources/SwiftDocC/Infrastructure/Topic Graph/AutomaticCuration.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ extension AutomaticCuration {
195195
case .`deinit`: return "Deinitializers"
196196
case .`enum`: return "Enumerations"
197197
case .`case`: return "Enumeration Cases"
198+
case .extension: return "Extensions"
198199
case .`func`: return "Functions"
199200
case .`operator`: return "Operators"
200201
case .`init`: return "Initializers"
@@ -204,6 +205,7 @@ extension AutomaticCuration {
204205
case .`property`: return "Instance Properties"
205206
case .`protocol`: return "Protocols"
206207
case .snippet: return "Snippets"
208+
case .snippetGroup: return "Snippets"
207209
case .`struct`: return "Structures"
208210
case .`subscript`: return "Subscripts"
209211
case .`typeMethod`: return "Type Methods"
@@ -255,5 +257,10 @@ extension AutomaticCuration {
255257
.extendedStructure,
256258
.extendedEnumeration,
257259
.unknownExtendedType,
260+
261+
.extension,
262+
263+
.snippet,
264+
.snippetGroup
258265
]
259266
}

Tests/SwiftDocCTests/Infrastructure/AutomaticCurationTests.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,17 @@ class AutomaticCurationTests: XCTestCase {
1717
func testAutomaticTopics() throws {
1818
// Create each kind of symbol and verify it gets its own topic group automatically
1919
let decoder = JSONDecoder()
20-
21-
for kind in AutomaticCuration.groupKindOrder where kind != .module {
20+
21+
var availableSymbolKinds = Set(AutomaticCuration.groupKindOrder)
22+
availableSymbolKinds.formUnion(SymbolGraph.Symbol.KindIdentifier.allCases)
23+
24+
for kind in availableSymbolKinds where kind != .module {
2225
// TODO: Synthesize appropriate `swift.extension` symbols that get transformed into
2326
// the respective internal symbol kinds as defined by `ExtendedTypeFormatTransformation`
2427
// and remove decoder injection logic from `DocumentationContext` and `SymbolGraphLoader`
2528
if !SymbolGraph.Symbol.KindIdentifier.allCases.contains(kind) {
2629
decoder.register(symbolKinds: kind)
2730
}
28-
2931
let (_, bundle, context) = try testBundleAndContext(copying: "TestBundle", excludingPaths: [], codeListings: [:], configureBundle: { url in
3032
let sidekitURL = url.appendingPathComponent("sidekit.symbols.json")
3133
let text = try String(contentsOf: sidekitURL)

0 commit comments

Comments
 (0)