@@ -302,50 +302,45 @@ describe("prepare_results", function()
302302 end
303303 end
304304 )
305- async .it (
306- " check that all nested results are in three_level_nested_test.go, quotes should be removed from keys" ,
307- -- three_level_nested_test.go::TestOdd::odd::5_is_odd
308- -- not three_level_nested_test.go::TestOdd::"odd"::5_is_odd
309- function ()
310- local tests_folder = vim .loop .cwd () .. " /neotest_go"
311- local test_file = tests_folder .. " /three_level_nested_test.go"
312- local positions = plugin .discover_positions (test_file )
305+ async .it (" check that all nested results are in three_level_nested_test.go" , function ()
306+ local tests_folder = vim .loop .cwd () .. " /neotest_go"
307+ local test_file = tests_folder .. " /three_level_nested_test.go"
308+ local positions = plugin .discover_positions (test_file )
313309
314- local expected_keys = {
315- test_file ,
316- test_file .. " ::TestOdd" ,
317- test_file .. " ::TestOdd::odd" ,
318- test_file .. " ::TestOdd::odd::7_is_odd" ,
319- test_file .. " ::TestOdd::odd::5_is_odd" ,
320- }
321- -- we should run test from module root
322- local command = {
323- " cd" ,
324- tests_folder ,
325- " &&" ,
326- " go" ,
327- " test" ,
328- " -v" ,
329- " -json" ,
330- " " ,
331- " -count=1" ,
332- " -timeout=60s" ,
333- " ./..." ,
334- }
335- local handle = io.popen (table.concat (command , " " ))
336- local result = handle :read (" *a" )
337- handle :close ()
310+ local expected_keys = {
311+ test_file ,
312+ test_file .. " ::TestOdd" ,
313+ test_file .. " ::TestOdd::odd" ,
314+ test_file .. ' ::TestOdd::" odd" ::7_is_odd' ,
315+ test_file .. ' ::TestOdd::" odd" ::5_is_odd' ,
316+ }
317+ -- we should run test from module root
318+ local command = {
319+ " cd" ,
320+ tests_folder ,
321+ " &&" ,
322+ " go" ,
323+ " test" ,
324+ " -v" ,
325+ " -json" ,
326+ " " ,
327+ " -count=1" ,
328+ " -timeout=60s" ,
329+ " ./..." ,
330+ }
331+ local handle = io.popen (table.concat (command , " " ))
332+ local result = handle :read (" *a" )
333+ handle :close ()
338334
339- local lines = {}
340- for s in result :gmatch (" [^\r\n ]+" ) do
341- table.insert (lines , s )
342- end
343- local processed_results = plugin .prepare_results (positions , lines , tests_folder , " neotest_go" )
344- for _ , v in pairs (expected_keys ) do
345- assert .has_property (v , processed_results )
346- end
335+ local lines = {}
336+ for s in result :gmatch (" [^\r\n ]+" ) do
337+ table.insert (lines , s )
347338 end
348- )
339+ local processed_results = plugin .prepare_results (positions , lines , tests_folder , " neotest_go" )
340+ for _ , v in pairs (expected_keys ) do
341+ assert .has_property (v , processed_results )
342+ end
343+ end )
349344
350345 async .it (" check that we have correct file level test result status" , function ()
351346 local tests_folder = vim .loop .cwd () .. " /neotest_go"
0 commit comments