From f12986c2aef7ef49c5e69851dea224afad900bdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20R=C3=B6nnqvist?= Date: Mon, 29 Sep 2025 17:02:40 +0200 Subject: [PATCH] Fix test that became flaky after recent snippets change Depending on which symbol was _first_ in the dictionary of symbols, the entire symbol graph was categorized as either a snippet symbol graph or a regular symbol graph. However, real symbol graph files don't mix snippets and framework symbols like that. This fixes the test to don't mix snippets with real symbols. It also stops adding module nodes inside the symbol graph, because that also doesn't match real symbol graph files. --- .../DocumentationContext/DocumentationContextTests.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Tests/SwiftDocCTests/Infrastructure/DocumentationContext/DocumentationContextTests.swift b/Tests/SwiftDocCTests/Infrastructure/DocumentationContext/DocumentationContextTests.swift index 0243657e8..acc5b9d50 100644 --- a/Tests/SwiftDocCTests/Infrastructure/DocumentationContext/DocumentationContextTests.swift +++ b/Tests/SwiftDocCTests/Infrastructure/DocumentationContext/DocumentationContextTests.swift @@ -4935,7 +4935,11 @@ let expected = """ func testContextDoesNotRecognizeNonOverloadableSymbolKinds() async throws { enableFeatureFlag(\.isExperimentalOverloadedSymbolPresentationEnabled) - let nonOverloadableKindIDs = SymbolGraph.Symbol.KindIdentifier.allCases.filter { !$0.isOverloadableKind } + let nonOverloadableKindIDs = SymbolGraph.Symbol.KindIdentifier.allCases.filter { + !$0.isOverloadableKind && + !$0.isSnippetKind && // avoid mixing snippets with "real" symbols + $0 != .module // avoid creating multiple modules + } // Generate a 4 symbols with the same name for every non overloadable symbol kind let symbols: [SymbolGraph.Symbol] = nonOverloadableKindIDs.flatMap { [ makeSymbol(id: "first-\($0.identifier)-id", kind: $0, pathComponents: ["SymbolName"]),