mirror of
https://github.com/love2d/love.git
synced 2026-08-12 16:40:57 +02:00
19df8040df
Initial commit of a basic test framework, see readme.md for more Most modules are covered with basic unit tests, and there's an example test for a graphics draw (rectangle) and object (File) - for object tests doing more scenario based so we can check multiple things together
19 lines
622 B
Lua
19 lines
622 B
Lua
-- love.sound
|
|
|
|
|
|
-- love.sound.newDecoder
|
|
-- @NOTE this is just basic nil checking, full obj test are in objects.lua
|
|
love.test.sound.newDecoder = function(test)
|
|
local decoder = love.sound.newDecoder('resources/click.ogg')
|
|
test:assertObject(decoder)
|
|
end
|
|
|
|
|
|
-- love.sound.newSoundData
|
|
-- @NOTE this is just basic nil checking, full obj test are in objects.lua
|
|
love.test.sound.newSoundData = function(test)
|
|
local sounddata = love.sound.newSoundData('resources/click.ogg')
|
|
test:assertObject(sounddata)
|
|
local soundbeep = love.sound.newSoundData(math.floor((1/32)*44100), 44100, 16, 1)
|
|
test:assertObject(soundbeep)
|
|
end |