mirror of
https://github.com/Insality/druid
synced 2025-09-27 18:12:21 +02:00
Add button basic tests
This commit is contained in:
@@ -19,4 +19,21 @@ function M.click_released(x, y)
|
||||
end
|
||||
|
||||
|
||||
function M.click_repeated(x, y)
|
||||
return hash("touch"), {
|
||||
repeated = true,
|
||||
x = x,
|
||||
y = y,
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
function M.input_empty(x, y)
|
||||
return hash("touch"), {
|
||||
x = x,
|
||||
y = y,
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
return M
|
||||
|
@@ -8,11 +8,12 @@ function M.get_context()
|
||||
end
|
||||
|
||||
|
||||
function M.get_function()
|
||||
-- Callback for return value from function
|
||||
function M.get_function(callback)
|
||||
local listener = {}
|
||||
listener.callback = function() end
|
||||
listener.callback = function() if callback then return callback() end end
|
||||
mock.mock(listener)
|
||||
return function(...) listener.callback(...) end, listener.callback
|
||||
return function(...) return listener.callback(...) end, listener.callback
|
||||
end
|
||||
|
||||
return M
|
||||
|
Reference in New Issue
Block a user