mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-19 04:46:45 +00:00
refactor: cleanup
This commit is contained in:
parent
37c7163f8d
commit
461552474c
4 changed files with 15 additions and 34 deletions
|
@ -21,7 +21,6 @@ describe("task", function()
|
|||
|
||||
it("simple function", function()
|
||||
local task = Task.new(plugin, "test", function() end, opts)
|
||||
assert(task:has_started())
|
||||
assert(task:is_running())
|
||||
task:wait()
|
||||
assert(not task:is_running())
|
||||
|
@ -32,7 +31,6 @@ describe("task", function()
|
|||
local task = Task.new(plugin, "test", function()
|
||||
error("test")
|
||||
end, opts)
|
||||
assert(task:has_started())
|
||||
assert(task:is_running())
|
||||
task:wait()
|
||||
assert(not task:is_running())
|
||||
|
@ -48,7 +46,6 @@ describe("task", function()
|
|||
coroutine.yield()
|
||||
running = false
|
||||
end, opts)
|
||||
assert(task:has_started())
|
||||
assert(task:is_running())
|
||||
assert(running)
|
||||
assert(task:is_running())
|
||||
|
@ -63,7 +60,6 @@ describe("task", function()
|
|||
local task = Task.new(plugin, "spawn_errors", function(task)
|
||||
task:spawn("foobar")
|
||||
end, opts)
|
||||
assert(task:has_started())
|
||||
assert(task:is_running())
|
||||
task:wait()
|
||||
assert(not task:is_running())
|
||||
|
@ -75,9 +71,7 @@ describe("task", function()
|
|||
local task = Task.new(plugin, "test", function(task)
|
||||
task:spawn("echo", { args = { "foo" } })
|
||||
end, opts)
|
||||
assert(task:has_started())
|
||||
assert(task:is_running())
|
||||
assert(task:has_started())
|
||||
assert(task:is_running())
|
||||
task:wait()
|
||||
assert.same(task:output(), "foo")
|
||||
|
@ -90,7 +84,6 @@ describe("task", function()
|
|||
task:spawn("echo", { args = { "foo" } })
|
||||
task:spawn("echo", { args = { "bar" } })
|
||||
end, opts)
|
||||
assert(task:has_started())
|
||||
assert(task:is_running())
|
||||
assert(task:is_running())
|
||||
task:wait()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue