@@ -88,6 +88,25 @@ for (const snapshotDirectory of snapshotDirectories) {
8888 document . symbols . map ( symbol => symbol . symbol )
8989 )
9090 )
91+ const externalSymbolInformation = new Set (
92+ index . external_symbols . map ( symbol => symbol . symbol )
93+ )
94+ assert . equal (
95+ externalSymbolInformation . size ,
96+ index . external_symbols . length ,
97+ 'external SymbolInformation should be unique'
98+ )
99+ assert . equal (
100+ index . external_symbols
101+ . map ( symbol => symbol . symbol )
102+ . filter ( symbol => symbolInformation . has ( symbol ) ) ,
103+ [ ] ,
104+ 'symbols should not be both internal and external'
105+ )
106+ const availableSymbols = new Set ( [
107+ ...symbolInformation ,
108+ ...externalSymbolInformation ,
109+ ] )
91110 const indexedPackages = new Set (
92111 [ ...symbolInformation ]
93112 . filter ( symbol => ! symbol . startsWith ( 'local ' ) )
@@ -121,6 +140,19 @@ for (const snapshotDirectory of snapshotDirectories) {
121140 [ ] ,
122141 `${ document . relative_path } should not contain duplicate occurrences`
123142 )
143+ const missingOccurrenceSymbols = document . occurrences
144+ . map ( occurrence => occurrence . symbol )
145+ . filter (
146+ symbol =>
147+ symbol &&
148+ ! symbol . startsWith ( 'local ' ) &&
149+ ! availableSymbols . has ( symbol )
150+ )
151+ assert . equal (
152+ missingOccurrenceSymbols ,
153+ [ ] ,
154+ `${ document . relative_path } global occurrences should have SymbolInformation`
155+ )
124156 const missingInternalSymbols = document . occurrences
125157 . map ( occurrence => occurrence . symbol )
126158 . filter (
@@ -157,7 +189,7 @@ for (const snapshotDirectory of snapshotDirectories) {
157189 ? fs . readFileSync ( outputPath ) . toString ( )
158190 : ''
159191 const input = Input . fromFile ( inputPath )
160- const obtained = formatSnapshot ( input , document )
192+ const obtained = formatSnapshot ( input , document , index . external_symbols )
161193 if ( obtained === expected ) {
162194 // Test passed
163195 continue
0 commit comments