refactor: cleanup

This commit is contained in:
Folke Lemaitre 2024-06-27 14:43:35 +02:00
parent 37c7163f8d
commit 461552474c
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
4 changed files with 15 additions and 34 deletions

View file

@ -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()