@@ -32,7 +32,7 @@ suite('Document Symbols Tests', () => {
3232 assert . equal ( symbols . length , 1 ) ;
3333 assert . deepEqual (
3434 symbols [ 0 ] ,
35- createExpectedSymbolInformation ( 'cwd' , 15 , undefined , TEST_URI , 0 , 0 , 0 , 9 )
35+ createExpectedSymbolInformation ( 'cwd' , 15 , "" , TEST_URI , 0 , 0 , 0 , 9 )
3636 ) ;
3737 } ) ;
3838
@@ -42,7 +42,7 @@ suite('Document Symbols Tests', () => {
4242 assert . equal ( symbols . length , 1 ) ;
4343 assert . deepEqual (
4444 symbols [ 0 ] ,
45- createExpectedSymbolInformation ( 'node1' , 16 , undefined , TEST_URI , 0 , 0 , 0 , 12 )
45+ createExpectedSymbolInformation ( 'node1' , 16 , "" , TEST_URI , 0 , 0 , 0 , 12 )
4646 ) ;
4747 } ) ;
4848
@@ -52,7 +52,7 @@ suite('Document Symbols Tests', () => {
5252 assert . equal ( symbols . length , 1 ) ;
5353 assert . deepEqual (
5454 symbols [ 0 ] ,
55- createExpectedSymbolInformation ( 'node1' , 17 , undefined , TEST_URI , 0 , 0 , 0 , 12 )
55+ createExpectedSymbolInformation ( 'node1' , 17 , "" , TEST_URI , 0 , 0 , 0 , 12 )
5656 ) ;
5757 } ) ;
5858
@@ -62,7 +62,7 @@ suite('Document Symbols Tests', () => {
6262 assert . equal ( symbols . length , 3 ) ;
6363 assert . deepEqual (
6464 symbols [ 0 ] ,
65- createExpectedSymbolInformation ( 'scripts' , 2 , undefined , TEST_URI , 0 , 0 , 2 , 13 )
65+ createExpectedSymbolInformation ( 'scripts' , 2 , "" , TEST_URI , 0 , 0 , 2 , 13 )
6666 ) ;
6767 assert . deepEqual (
6868 symbols [ 1 ] ,
@@ -80,7 +80,7 @@ suite('Document Symbols Tests', () => {
8080 assert . equal ( symbols . length , 1 ) ;
8181 assert . deepEqual (
8282 symbols [ 0 ] ,
83- createExpectedSymbolInformation ( 'apiVersion' , SymbolKind . Variable , undefined , TEST_URI , 0 , 0 , 0 , 16 )
83+ createExpectedSymbolInformation ( 'apiVersion' , SymbolKind . Variable , "" , TEST_URI , 0 , 0 , 0 , 16 )
8484 ) ;
8585 } ) ;
8686
@@ -90,7 +90,7 @@ suite('Document Symbols Tests', () => {
9090 assert . equal ( symbols . length , 1 ) ;
9191 assert . deepEqual (
9292 symbols [ 0 ] ,
93- createExpectedSymbolInformation ( 'items' , SymbolKind . Array , undefined , TEST_URI , 0 , 0 , 2 , 8 )
93+ createExpectedSymbolInformation ( 'items' , SymbolKind . Array , "" , TEST_URI , 0 , 0 , 2 , 8 )
9494 ) ;
9595 } ) ;
9696
@@ -100,7 +100,7 @@ suite('Document Symbols Tests', () => {
100100 assert . equal ( symbols . length , 3 ) ;
101101 assert . deepEqual (
102102 symbols [ 0 ] ,
103- createExpectedSymbolInformation ( 'authors' , 18 , undefined , TEST_URI , 0 , 0 , 2 , 13 )
103+ createExpectedSymbolInformation ( 'authors' , 18 , "" , TEST_URI , 0 , 0 , 2 , 13 )
104104 ) ;
105105 assert . deepEqual (
106106 symbols [ 1 ] ,
@@ -116,29 +116,33 @@ suite('Document Symbols Tests', () => {
116116 const content = 'scripts:\n node1: test\n node2: test\nauthors:\n - name: Josh\n - email: jp' ;
117117 const symbols = parseNonHierarchicalSetup ( content ) ;
118118 assert . equal ( symbols . length , 6 ) ;
119+
120+ // Sort the items first so they have predictable order in the array
121+ symbols . sort ( ( a , b ) => a . name . localeCompare ( b . name ) ) ;
122+
119123 assert . deepEqual (
120124 symbols [ 0 ] ,
121- createExpectedSymbolInformation ( 'scripts ' , 2 , undefined , TEST_URI , 0 , 0 , 2 , 13 )
125+ createExpectedSymbolInformation ( 'authors ' , 18 , "" , TEST_URI , 3 , 0 , 5 , 13 )
122126 ) ;
123127 assert . deepEqual (
124128 symbols [ 1 ] ,
125- createExpectedSymbolInformation ( 'node1 ' , 15 , 'scripts ' , TEST_URI , 1 , 2 , 1 , 13 )
129+ createExpectedSymbolInformation ( 'email ' , 15 , 'authors ' , TEST_URI , 5 , 4 , 5 , 13 )
126130 ) ;
127131 assert . deepEqual (
128132 symbols [ 2 ] ,
129- createExpectedSymbolInformation ( 'node2 ' , 15 , 'scripts ' , TEST_URI , 2 , 2 , 2 , 13 )
133+ createExpectedSymbolInformation ( 'name ' , 15 , 'authors ' , TEST_URI , 4 , 4 , 4 , 14 )
130134 ) ;
131135 assert . deepEqual (
132136 symbols [ 3 ] ,
133- createExpectedSymbolInformation ( 'authors ' , 18 , undefined , TEST_URI , 3 , 0 , 5 , 13 )
137+ createExpectedSymbolInformation ( 'node1 ' , 15 , 'scripts' , TEST_URI , 1 , 2 , 1 , 13 )
134138 ) ;
135139 assert . deepEqual (
136140 symbols [ 4 ] ,
137- createExpectedSymbolInformation ( 'name ' , 15 , 'authors ' , TEST_URI , 4 , 4 , 4 , 14 )
141+ createExpectedSymbolInformation ( 'node2 ' , 15 , 'scripts ' , TEST_URI , 2 , 2 , 2 , 13 )
138142 ) ;
139143 assert . deepEqual (
140144 symbols [ 5 ] ,
141- createExpectedSymbolInformation ( 'email ' , 15 , 'authors' , TEST_URI , 5 , 4 , 5 , 13 )
145+ createExpectedSymbolInformation ( 'scripts ' , 2 , "" , TEST_URI , 0 , 0 , 2 , 13 )
142146 ) ;
143147 } ) ;
144148
@@ -148,11 +152,11 @@ suite('Document Symbols Tests', () => {
148152 assert . equal ( symbols . length , 2 ) ;
149153 assert . deepEqual (
150154 symbols [ 0 ] ,
151- createExpectedSymbolInformation ( 'analytics' , 17 , undefined , TEST_URI , 1 , 0 , 1 , 15 )
155+ createExpectedSymbolInformation ( 'analytics' , 17 , "" , TEST_URI , 1 , 0 , 1 , 15 )
152156 ) ;
153157 assert . deepEqual (
154158 symbols [ 1 ] ,
155- createExpectedSymbolInformation ( 'json' , 15 , undefined , TEST_URI , 4 , 0 , 4 , 10 )
159+ createExpectedSymbolInformation ( 'json' , 15 , "" , TEST_URI , 4 , 0 , 4 , 10 )
156160 ) ;
157161 } ) ;
158162
0 commit comments