Add initial Druid tests

This commit is contained in:
Insality
2022-09-11 12:16:20 +03:00
parent cb5df2b5bc
commit a6de0128bd
8 changed files with 195 additions and 4 deletions

View File

@@ -0,0 +1,22 @@
local M = {}
function M.click_pressed(x, y)
return hash("touch"), {
pressed = true,
x = x,
y = y,
}
end
function M.click_released(x, y)
return hash("touch"), {
released = true,
x = x,
y = y,
}
end
return M

View File

@@ -0,0 +1,18 @@
local mock = require("deftest.mock.mock")
local M = {}
-- Userdata type instead of script self
function M.get_context()
return vmath.vector()
end
function M.get_function()
local listener = {}
listener.callback = function() end
mock.mock(listener)
return function(...) listener.callback(...) end, listener.callback
end
return M