Improve API of test/_client.lua
The first return value was always true. How useless... Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
f9cdc98c73
commit
3a7e14e5d7
|
@ -96,8 +96,7 @@ return function(class, title, sn_rules, callback)
|
||||||
local success, msg = pipe:write_all(data)
|
local success, msg = pipe:write_all(data)
|
||||||
assert(success, msg)
|
assert(success, msg)
|
||||||
|
|
||||||
-- TODO: Fix the API of this function
|
return snid
|
||||||
return true, (sn_rules or callback) and snid or nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||||
|
|
|
@ -12,7 +12,7 @@ client.connect_signal("manage", function(c)
|
||||||
tostring(c.machine) .. " ~= " .. tostring(awesome.hostname))
|
tostring(c.machine) .. " ~= " .. tostring(awesome.hostname))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local ret, snid
|
local snid
|
||||||
local num_callbacks = 0
|
local num_callbacks = 0
|
||||||
local function callback(c)
|
local function callback(c)
|
||||||
assert(c.startup_id == snid)
|
assert(c.startup_id == snid)
|
||||||
|
@ -22,9 +22,8 @@ end
|
||||||
local steps = {
|
local steps = {
|
||||||
function(count)
|
function(count)
|
||||||
if count == 1 then
|
if count == 1 then
|
||||||
ret, snid = test_client("foo", "bar", true)
|
snid = test_client("foo", "bar", true)
|
||||||
elseif manage_called then
|
elseif manage_called then
|
||||||
assert(ret)
|
|
||||||
assert(snid)
|
assert(snid)
|
||||||
assert(snid == c_snid)
|
assert(snid == c_snid)
|
||||||
return true
|
return true
|
||||||
|
@ -36,10 +35,8 @@ local steps = {
|
||||||
function(count)
|
function(count)
|
||||||
if count == 1 then
|
if count == 1 then
|
||||||
manage_called = false
|
manage_called = false
|
||||||
ret, snid = test_client("bar", "foo", false)
|
test_client("bar", "foo", false)
|
||||||
elseif manage_called then
|
elseif manage_called then
|
||||||
assert(ret)
|
|
||||||
assert(snid == nil)
|
|
||||||
assert(c_snid == nil, "c.startup_snid should be nil!")
|
assert(c_snid == nil, "c.startup_snid should be nil!")
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
@ -48,9 +45,8 @@ local steps = {
|
||||||
function(count)
|
function(count)
|
||||||
if count == 1 then
|
if count == 1 then
|
||||||
manage_called = false
|
manage_called = false
|
||||||
ret, snid = test_client("baz", "barz", false, callback)
|
snid = test_client("baz", "barz", false, callback)
|
||||||
elseif manage_called then
|
elseif manage_called then
|
||||||
assert(ret)
|
|
||||||
assert(snid)
|
assert(snid)
|
||||||
assert(snid == c_snid)
|
assert(snid == c_snid)
|
||||||
assert(num_callbacks == 1, num_callbacks)
|
assert(num_callbacks == 1, num_callbacks)
|
||||||
|
|
Loading…
Reference in New Issue