FANDOM


local prettyPre = require('Module:Pretty-pre')._main
local ScribuntoUnit = require('Module:ScribuntoUnit')
local suite = ScribuntoUnit:new()
 
--------------------------------------------------------------------------------
-- Basic tests
--------------------------------------------------------------------------------
function suite:test_one_line()
    self:assertEquals(' text', prettyPre('text'))
end
 
function suite:test_multiple_lines()
    self:assertEquals(' text\n text', prettyPre('text\ntext'))
end
 
function suite:test_one_trailing_newline()
    self:assertEquals(' text', prettyPre('text\n'))
end
 
function suite:test_multiple_trailing_newlines()
    self:assertEquals(' text\n \n ', prettyPre('text\n\n\n'))
end
 
--------------------------------------------------------------------------------
-- Unicode tests
-- Note: "يونيكود" is just the word "unicode" in Arabic.
--------------------------------------------------------------------------------
function suite:test_unicode_one_line()
    self:assertEquals(' يونيكود', prettyPre('يونيكود'))
end
 
function suite:test_unicode_multiple_lines()
    self:assertEquals(' يونيكود\n يونيكود', prettyPre('يونيكود\nيونيكود'))
end
 
function suite:test_unicode_one_trailing_newline()
    self:assertEquals(' يونيكود', prettyPre('يونيكود\n'))
end
 
function suite:test_unicode_multiple_trailing_newlines()
    self:assertEquals(' يونيكود\n \n ', prettyPre('يونيكود\n\n\n'))
end
 
return suite

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.