-- Tests for the mw.svg module local testframework = require 'Module:TestFramework' local function testSvgToString() local svg = mw.svg.new() svg:setContent('') svg:setAttribute('width', '20px') svg:setAttribute('test-special-chars', '<>&\'"') return svg:toString() end local function testSvgToImage() local svg = mw.svg.new() svg:setContent('') svg:setAttribute('width', '20px') svg:setAttribute('height', '20px') svg:setImgAttribute('width', '20px') return mw.text.killMarkers(svg:toImage()) end -- Tests local tests = { { name = 'mw.svg toString', func = testSvgToString, expect = { '' } }, { -- Verify toImage() returns a strip item name = 'mw.svg toImage', func = testSvgToImage, expect = { '' } } } return testframework.getTestProvider( tests )