File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -130,15 +130,17 @@ NeotestAdapter.discover_positions = function(file_path)
130130
131131 --- @type { [string] : neotest.Position }
132132 local tests_by_name = {}
133- --- @type rustaceanvim.neotest.Position[]
133+ --- @type table<string , rustaceanvim.neotest.Position>
134134 local namespaces = {}
135135 for _ , pos in pairs (positions ) do
136136 if pos .type == ' test' then
137137 tests_by_name [pos .name ] = pos
138138 elseif pos .type == ' namespace' then
139- table.insert ( namespaces , pos )
139+ namespaces [ pos . id ] = pos
140140 end
141141 end
142+ namespaces = vim .tbl_values (namespaces )
143+ --- @cast namespaces rustaceanvim.neotest.Position[]
142144
143145 -- sort namespaces by name from longest to shortest
144146 table.sort (namespaces , function (a , b )
@@ -398,7 +400,6 @@ function NeotestAdapter.results(spec, strategy_result)
398400 local failure_diagnostic = vim .iter (diagnostics ):find (function (diag )
399401 return vim .endswith (data .id , diag .test_id )
400402 end )
401-
402403 if failure_diagnostic then
403404 results [data .id ] = {
404405 status = ' failed' ,
You can’t perform that action at this time.
0 commit comments