@@ -224,4 +224,42 @@ class DeclarationsRenderSectionTests: XCTestCase {
224
224
] ,
225
225
] )
226
226
}
227
+
228
+ func testDontHighlightWhenOverloadsAreDisabled( ) throws {
229
+ let symbolGraphFile = Bundle . module. url (
230
+ forResource: " FancyOverloads " ,
231
+ withExtension: " symbols.json " ,
232
+ subdirectory: " Test Resources "
233
+ ) !
234
+
235
+ let tempURL = try createTempFolder ( content: [
236
+ Folder ( name: " unit-test.docc " , content: [
237
+ InfoPlist ( displayName: " FancyOverloads " , identifier: " com.test.example " ) ,
238
+ CopyOfFile ( original: symbolGraphFile) ,
239
+ ] )
240
+ ] )
241
+
242
+ let ( _, bundle, context) = try loadBundle ( from: tempURL)
243
+
244
+ for hash in [ " 1dd3k " , " 4alrf " ] {
245
+ let reference = ResolvedTopicReference (
246
+ bundleIdentifier: bundle. identifier,
247
+ path: " /documentation/FancyOverloads/MyClass/myFunc(param:)- \( hash) " ,
248
+ sourceLanguage: . swift
249
+ )
250
+ let symbol = try XCTUnwrap ( context. entity ( with: reference) . semantic as? Symbol )
251
+ var translator = RenderNodeTranslator (
252
+ context: context,
253
+ bundle: bundle,
254
+ identifier: reference,
255
+ source: nil
256
+ )
257
+ let renderNode = try XCTUnwrap ( translator. visitSymbol ( symbol) as? RenderNode )
258
+ let declarationsSection = try XCTUnwrap ( renderNode. primaryContentSections. compactMap ( { $0 as? DeclarationsRenderSection } ) . first)
259
+ XCTAssertEqual ( declarationsSection. declarations. count, 1 )
260
+ let declarations = try XCTUnwrap ( declarationsSection. declarations. first)
261
+
262
+ XCTAssert ( declarations. tokens. allSatisfy ( { $0. highlight == nil } ) )
263
+ }
264
+ }
227
265
}
0 commit comments