Skip to content

Commit 41c3931

Browse files
committed
tests: use built-in blocking feature of osv instead of callback
1 parent 672a435 commit 41c3931

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

tests/child_helper.lua

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
local env = require("tests.env")
22
local M = {}
3-
_G.attach_debugger = false
3+
4+
if not _G.attach_debugger then
5+
_G.attach_debugger = false
6+
end
47

58
---@param test_name string
69
function M.new_child_neovim(test_name)
710
---@class MiniTest.child
811
local child = MiniTest.new_child_neovim()
912
local logfile = string.format("./tests/logs/%s.log", test_name)
10-
11-
-- TODO: this needs a reset, as it is reused in multiple tests
12-
-- TODO: this does not work, as the child needs a string representation of the config
1313
child.config = nil
1414

1515
if vim.fn.filereadable(logfile) == 1 then
@@ -53,12 +53,7 @@ function M.new_child_neovim(test_name)
5353
end
5454

5555
child.lua([[
56-
local osv = require("osv")
57-
local debugger_attached = false
58-
osv.on_attach = function() debugger_attached = true end
59-
osv.launch({ port = 8086 })
60-
-- wait until a debuggee is attached, or 30 seconds
61-
vim.wait(30000, function() return debugger_attached end, 10)
56+
require("osv").launch({ port = 8086, blocking = true })
6257
]])
6358
end
6459

0 commit comments

Comments
 (0)