mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
2875a96e92
- update main love readme to include note on tests - added module tests for Sensor, Keyboard, Touch, Joystick, Mouse, and Love (for hooks + basic love-level methods) - general clean-up of main class logic - couple fixes for runner-specific failures (physics.Joint, audio.getActiveSourceCount, mouse.getPosition) - change window.close test to run last
34 lines
1.2 KiB
Lua
34 lines
1.2 KiB
Lua
-- love.touch
|
|
-- @NOTE we can't test this module fully as it's hardware dependent
|
|
-- however we can test methods do what is expected and can handle certain params
|
|
|
|
--------------------------------------------------------------------------------
|
|
--------------------------------------------------------------------------------
|
|
------------------------------------METHODS-------------------------------------
|
|
--------------------------------------------------------------------------------
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
-- love.touch.getPosition
|
|
-- @TODO is there a way to fake the touchid pointer?
|
|
love.test.touch.getPosition = function(test)
|
|
test:assertNotNil(love.touch.getPosition)
|
|
test:assertEquals('function', type(love.touch.getPosition))
|
|
end
|
|
|
|
|
|
-- love.touch.getPressure
|
|
-- @TODO is there a way to fake the touchid pointer?
|
|
love.test.touch.getPressure = function(test)
|
|
test:assertNotNil(love.touch.getPressure)
|
|
test:assertEquals('function', type(love.touch.getPressure))
|
|
end
|
|
|
|
|
|
-- love.touch.getTouches
|
|
love.test.touch.getTouches = function(test)
|
|
local touches = love.touch.getTouches()
|
|
test:assertNotNil(touches)
|
|
test:assertEquals(0, #touches, 'check no touches')
|
|
end
|