mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
test updates
- 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
This commit is contained in:
@@ -188,6 +188,10 @@ love.test.audio.Source = function(test)
|
||||
local filtersettings = effsource:getEffect('effectthatdoesntexist', {})
|
||||
test:assertNotNil(filtersettings)
|
||||
|
||||
love.audio.stop(stereo)
|
||||
love.audio.stop(mono)
|
||||
love.audio.stop(effsource)
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -218,6 +222,7 @@ love.test.audio.getActiveSourceCount = function(test)
|
||||
test:assertNotNil(love.audio.getActiveSourceCount())
|
||||
-- check source isn't active by default
|
||||
local testsource = love.audio.newSource('resources/click.ogg', 'static')
|
||||
love.audio.stop(testsource)
|
||||
test:assertEquals(0, love.audio.getActiveSourceCount(), 'check not active')
|
||||
-- check playing a source marks it as active
|
||||
love.audio.play(testsource)
|
||||
@@ -363,6 +368,7 @@ love.test.audio.pause = function(test)
|
||||
love.audio.play(source)
|
||||
local onepause = love.audio.pause()
|
||||
test:assertEquals(1, #onepause, 'check 1 paused')
|
||||
love.audio.stop(source)
|
||||
end
|
||||
|
||||
|
||||
@@ -372,7 +378,7 @@ love.test.audio.play = function(test)
|
||||
local source = love.audio.newSource('resources/click.ogg', 'static')
|
||||
love.audio.play(source)
|
||||
test:assertTrue(source:isPlaying(), 'check something playing')
|
||||
love.audio.pause()
|
||||
love.audio.stop()
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user