Difference between revisions of "Template:Documentation/preload-module-testcases"

From blackwiki
Jump to navigation Jump to search
test>Ans
(tab)
test>Gonnym
(No reason why this needs to be manually changed by users. It should automatically have the actual module name.)
Line 1: Line 1:
-- Example Unit tests for [[Module:Bananas]]. Click talk page to run tests.
+
-- Unit tests for [[Module:{{ROOTPAGENAME}}]]. Click talk page to run tests.
 
local p = require('Module:UnitTests')
 
local p = require('Module:UnitTests')
  
 +
-- Example unit test.
 
function p:test_hello()
 
function p:test_hello()
 
self:preprocess_equals('{{#invoke:Bananas | hello}}', 'Hello, world!')
 
self:preprocess_equals('{{#invoke:Bananas | hello}}', 'Hello, world!')

Revision as of 11:58, 12 December 2019

-- Unit tests for Module:Documentation. Click talk page to run tests. local p = require('Module:UnitTests')

-- Example unit test. function p:test_hello() self:preprocess_equals('Script error: No such module "Bananas".', 'Hello, world!') end

return p