mirror of
https://github.com/love2d/love.git
synced 2026-08-12 16:40:57 +02:00
e03b2db08b
- Added tests for all obj creation, transformation, window + system info graphics methods
- Added half the state methods for graphics + added placeholders for missing drawing methods
- Added TestMethod:assertNotNil() for quick nil checking
- Added time total to the end of each module summary in console log to match file output
- Removed a bunch of unessecary nil checks
- Removed :release() from test methods, collectgarbage("collect") is called between methods instead
- Renamed /output to /examples to avoid confusion
- Replaced love.filesystem.newFile with love.filesystem.openFile
- Replaced love.math.noise with love.math.perlinNoise / love.math.simplexNoise
- Fixed newGearJoint throwing an error in 12 as body needs to be dynamic not static now
- Some general cleanup, incl. better comments and time format in file output
44 lines
1.5 KiB
Lua
44 lines
1.5 KiB
Lua
-- love.font
|
|
|
|
|
|
-- love.font.newBMFontRasterizer
|
|
-- @NOTE the wiki specifies diff. params to source code and trying to do
|
|
-- what source code wants gives some errors still
|
|
love.test.font.newBMFontRasterizer = function(test)
|
|
test:skipTest('wiki and source dont match, not sure expected usage')
|
|
end
|
|
|
|
|
|
-- love.font.newGlyphData
|
|
-- @NOTE this is just basic nil checking, full obj test are in objects.lua
|
|
love.test.font.newGlyphData = function(test)
|
|
local img = love.image.newImageData('resources/love.png')
|
|
local rasterizer = love.font.newImageRasterizer(img, 'ABC', 0, 1);
|
|
local glyphdata = love.font.newGlyphData(rasterizer, 65)
|
|
test:assertObject(glyphdata)
|
|
end
|
|
|
|
|
|
-- love.font.newImageRasterizer
|
|
-- @NOTE this is just basic nil checking, full obj test are in objects.lua
|
|
love.test.font.newImageRasterizer = function(test)
|
|
local img = love.image.newImageData('resources/love.png')
|
|
local rasterizer = love.font.newImageRasterizer(img, 'ABC', 0, 1);
|
|
test:assertObject(rasterizer)
|
|
end
|
|
|
|
|
|
-- love.font.newRasterizer
|
|
-- @NOTE this is just basic nil checking, full obj test are in objects.lua
|
|
love.test.font.newRasterizer = function(test)
|
|
test:assertObject(love.font.newRasterizer('resources/font.ttf'))
|
|
end
|
|
|
|
|
|
-- love.font.newTrueTypeRasterizer
|
|
-- @NOTE this is just basic nil checking, full obj test are in objects.lua
|
|
love.test.font.newTrueTypeRasterizer = function(test)
|
|
test:assertObject(love.font.newTrueTypeRasterizer(12, "normal", 1))
|
|
test:assertObject(love.font.newTrueTypeRasterizer('resources/font.ttf', 8, "normal", 1))
|
|
end
|