@@ -333,51 +333,3 @@ def def_request(file_path, line, char):
333
333
assert len (exp_results ) + 1 == len (results )
334
334
for i in range (len (exp_results )):
335
335
check_return (results [i + 1 ], exp_results [i ])
336
-
337
-
338
- def test_refs ():
339
- def check_return (result_array , checks ):
340
- def find_in_results (uri , sline ):
341
- for (i , result ) in enumerate (result_array ):
342
- if (result ["uri" ] == uri ) and (
343
- result ["range" ]["start" ]["line" ] == sline
344
- ):
345
- del result_array [i ]
346
- return result
347
- return None
348
-
349
- assert len (result_array ) == len (checks )
350
- for check in checks :
351
- result = find_in_results (path_to_uri (check [0 ]), check [1 ])
352
- assert result is not None
353
- assert result ["range" ]["start" ]["character" ] == check [2 ]
354
- assert result ["range" ]["end" ]["character" ] == check [3 ]
355
-
356
- #
357
- string = write_rpc_request (1 , "initialize" , {"rootPath" : str (test_dir )})
358
- file_path = test_dir / "test_prog.f08"
359
- string += write_rpc_request (
360
- 2 ,
361
- "textDocument/references" ,
362
- {
363
- "textDocument" : {"uri" : str (file_path )},
364
- "position" : {"line" : 9 , "character" : 8 },
365
- },
366
- )
367
- errcode , results = run_request (string )
368
- assert errcode == 0
369
- #
370
- free_path = str (test_dir / "subdir" / "test_free.f90" )
371
- check_return (
372
- results [1 ],
373
- (
374
- [str (test_dir / "test_prog.f08" ), 2 , 21 , 27 ],
375
- [str (test_dir / "test_prog.f08" ), 9 , 5 , 11 ],
376
- [free_path , 8 , 8 , 14 ],
377
- [free_path , 16 , 9 , 15 ],
378
- [free_path , 18 , 14 , 20 ],
379
- [free_path , 36 , 6 , 12 ],
380
- [free_path , 44 , 6 , 12 ],
381
- [free_path , 78 , 6 , 12 ],
382
- ),
383
- )
0 commit comments