@@ -20,9 +20,9 @@ class DoxygenTests: XCTestCase {
20
20
let documentationLines : [ SymbolGraph . LineList . Line ] = """
21
21
This is an abstract.
22
22
23
- @discussion This is a discussion.
23
+ @discussion This is a discussion linking to ``AnotherClass`` and ``AnotherClass/prop`` .
24
24
25
- @note This is a note.
25
+ @note This is a note linking to ``Class3`` and ``Class3/prop2`` .
26
26
"""
27
27
. splitByNewlines
28
28
. enumerated ( )
@@ -46,7 +46,43 @@ class DoxygenTests: XCTestCase {
46
46
accessLevel: . public,
47
47
kind: . init( parsedIdentifier: . class, displayName: " Kind Display Name " ) ,
48
48
mixins: [ : ]
49
- )
49
+ ) ,
50
+ SymbolGraph . Symbol (
51
+ identifier: . init( precise: " another-class-id " , interfaceLanguage: SourceLanguage . swift. id) ,
52
+ names: . init( title: " AnotherClass " , navigator: nil , subHeading: nil , prose: nil ) ,
53
+ pathComponents: [ " AnotherClass " ] ,
54
+ docComment: nil ,
55
+ accessLevel: . public,
56
+ kind: . init( parsedIdentifier: . class, displayName: " Kind Display Name " ) ,
57
+ mixins: [ : ]
58
+ ) ,
59
+ SymbolGraph . Symbol (
60
+ identifier: . init( precise: " another-class-prop-id " , interfaceLanguage: SourceLanguage . swift. id) ,
61
+ names: . init( title: " prop " , navigator: nil , subHeading: nil , prose: nil ) ,
62
+ pathComponents: [ " AnotherClass " , " prop " ] ,
63
+ docComment: nil ,
64
+ accessLevel: . public,
65
+ kind: . init( parsedIdentifier: . property, displayName: " Kind Display Name " ) ,
66
+ mixins: [ : ]
67
+ ) ,
68
+ SymbolGraph . Symbol (
69
+ identifier: . init( precise: " class3-id " , interfaceLanguage: SourceLanguage . swift. id) ,
70
+ names: . init( title: " Class3 " , navigator: nil , subHeading: nil , prose: nil ) ,
71
+ pathComponents: [ " Class3 " ] ,
72
+ docComment: nil ,
73
+ accessLevel: . public,
74
+ kind: . init( parsedIdentifier: . class, displayName: " Kind Display Name " ) ,
75
+ mixins: [ : ]
76
+ ) ,
77
+ SymbolGraph . Symbol (
78
+ identifier: . init( precise: " class3-prop-id " , interfaceLanguage: SourceLanguage . swift. id) ,
79
+ names: . init( title: " prop " , navigator: nil , subHeading: nil , prose: nil ) ,
80
+ pathComponents: [ " Class3 " , " prop " ] ,
81
+ docComment: nil ,
82
+ accessLevel: . public,
83
+ kind: . init( parsedIdentifier: . property, displayName: " Kind Display Name " ) ,
84
+ mixins: [ : ]
85
+ ) ,
50
86
]
51
87
) ) ,
52
88
] )
@@ -60,7 +96,10 @@ class DoxygenTests: XCTestCase {
60
96
let symbol = try XCTUnwrap ( node. semantic as? Symbol )
61
97
62
98
XCTAssertEqual ( symbol. abstract? . format ( ) , " This is an abstract. " )
63
- XCTAssertEqual ( symbol. discussion? . content. map { $0. format ( ) } , [ #"\discussion This is a discussion."# , #"\note This is a note."# ] )
99
+ XCTAssertEqual ( symbol. discussion? . content. map { $0. format ( ) } , [
100
+ #"\discussion This is a discussion linking to ``doc://unit-test/documentation/ModuleName/AnotherClass`` and ``doc://unit-test/documentation/ModuleName/AnotherClass/prop``."# ,
101
+ #"\note This is a note linking to ``doc://unit-test/documentation/ModuleName/Class3`` and ``Class3/prop2``."#
102
+ ] )
64
103
65
104
// Verify the expected content in the render model
66
105
var translator = RenderNodeTranslator ( context: context, bundle: bundle, identifier: node. reference, source: nil )
@@ -71,17 +110,39 @@ class DoxygenTests: XCTestCase {
71
110
72
111
let overviewSection = try XCTUnwrap ( renderNode. primaryContentSections. first as? ContentRenderSection )
73
112
XCTAssertEqual ( overviewSection. content. count, 3 )
74
-
75
113
XCTAssertEqual ( overviewSection. content, [
76
114
. heading( . init( level: 2 , text: " Overview " , anchor: " overview " ) ) ,
77
115
78
116
. paragraph( . init( inlineContent: [
79
- . text( " This is a discussion. " )
117
+ . text( " This is a discussion linking to " ) ,
118
+ . reference(
119
+ identifier: . init( " doc://unit-test/documentation/ModuleName/AnotherClass " ) ,
120
+ isActive: true ,
121
+ overridingTitle: nil ,
122
+ overridingTitleInlineContent: nil
123
+ ) ,
124
+ . text( " and " ) ,
125
+ . reference(
126
+ identifier: . init( " doc://unit-test/documentation/ModuleName/AnotherClass/prop " ) ,
127
+ isActive: true ,
128
+ overridingTitle: nil ,
129
+ overridingTitleInlineContent: nil
130
+ ) ,
131
+ . text( " . " )
80
132
] ) ) ,
81
133
82
134
. aside( . init( style: . init( asideKind: . note) , content: [
83
135
. paragraph( . init( inlineContent: [
84
- . text( " This is a note. " )
136
+ . text( " This is a note linking to " ) ,
137
+ . reference(
138
+ identifier: . init( " doc://unit-test/documentation/ModuleName/Class3 " ) ,
139
+ isActive: true ,
140
+ overridingTitle: nil ,
141
+ overridingTitleInlineContent: nil
142
+ ) ,
143
+ . text( " and " ) ,
144
+ . codeVoice( code: " Class3/prop2 " ) ,
145
+ . text( " . " )
85
146
] ) )
86
147
] ) ) ,
87
148
] )
0 commit comments