Small cleanup to test-spawn.lua

This removes a duplicate test and moves some "spawn with empty string as
argument" up to the long list of similar tests (and adds error
checking).

I do not see the point of the assert(#client.get() == 0) and so it was
just dropped.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2016-12-25 14:46:57 +01:00
parent 461da9ea4b
commit 59cd409517
1 changed files with 3 additions and 11 deletions

View File

@ -29,6 +29,9 @@ local steps = {
error_message = spawn(" ")
assert(string.find(error_message, 'Text was empty'), error_message)
error_message = spawn("")
assert(string.find(error_message, 'Text was empty'), error_message)
error_message = spawn{}
assert(string.find(error_message, 'There is nothing to execute'), error_message)
@ -90,17 +93,6 @@ local steps = {
return true
end
end,
function()
-- Test empty command table
spawn{}
return true
end,
function()
-- Test empty command string
spawn("")
assert(#client.get() == 0)
return true
end,
}
runner.run_steps(steps)