Module:Page assessment/testcases: Difference between revisions
Appearance
Content deleted Content added
start testcases |
fixes |
||
Line 9: | Line 9: | ||
-- From article |
-- From article |
||
local subjectWikitext, talkWikitext = liveMod.getWikitext("Wikipedia") |
local subjectWikitext, talkWikitext = liveMod.getWikitext("Wikipedia") |
||
self:assertTrue(mw.ustring.len(subjectWikitext) > 100) |
self:assertTrue(mw.ustring.len(subjectWikitext) > 100, "Wikitext of page 'Wikipedia' more than 100 chars") |
||
self:assertTrue(mw.ustring.len(subjectWikitext) > 100) |
self:assertTrue(mw.ustring.len(subjectWikitext) > 100, "Wikitext of page 'Talk:Wikipedia' more than 100 chars") |
||
self: |
self:assertFalse(subjectWikitext == talkWikitext, "Subject page is different to talk page") |
||
end |
|||
⚫ | |||
function suite:testGetWikitext_sandbox() |
|||
self:assertTrue(mw.ustring.len(subjectWikitext_sb) > 100) |
|||
-- From article |
|||
self:assertTrue(mw.ustring.len(talkWikitext_sb) > 100) |
|||
⚫ | |||
self:assertNotEqual(subjectWikitext_sb, talkWikitext_sb) |
|||
self:assertTrue(mw.ustring.len(subjectWikitext) > 100, "Wikitext of page 'Wikipedia' more than 100 chars") |
|||
self. |
self:assertTrue(mw.ustring.len(subjectWikitext) > 100, "Wikitext of page 'Talk:Wikipedia' more than 100 chars") |
||
self |
self:assertFalse(subjectWikitext == talkWikitext, "Subject page is different to talk page") |
||
end |
end |
||
Revision as of 03:40, 30 December 2020
![]() | This is the test cases page for the module Module:Page assessment. Results of the test cases. |
-- Unit tests for [[Module:Page assessment}}]]. Click talk page to run tests.
local ScribuntoUnit = require('Module:ScribuntoUnit')
local liveMod = require('Module:Page assessment').util -- the module to be tested
local sandbox = require('Module:Page assessment/sandbox').test -- the module to be tested
local suite = ScribuntoUnit:new()
function suite:testGetWikitext()
-- From article
local subjectWikitext, talkWikitext = liveMod.getWikitext("Wikipedia")
self:assertTrue(mw.ustring.len(subjectWikitext) > 100, "Wikitext of page 'Wikipedia' more than 100 chars")
self:assertTrue(mw.ustring.len(subjectWikitext) > 100, "Wikitext of page 'Talk:Wikipedia' more than 100 chars")
self:assertFalse(subjectWikitext == talkWikitext, "Subject page is different to talk page")
end
function suite:testGetWikitext_sandbox()
-- From article
local subjectWikitext, talkWikitext = sandbox.getWikitext("Wikipedia")
self:assertTrue(mw.ustring.len(subjectWikitext) > 100, "Wikitext of page 'Wikipedia' more than 100 chars")
self:assertTrue(mw.ustring.len(subjectWikitext) > 100, "Wikitext of page 'Talk:Wikipedia' more than 100 chars")
self:assertFalse(subjectWikitext == talkWikitext, "Subject page is different to talk page")
end
--[[
function suite:testSomeOtherCall()
self:assertEquals('expected value', myModule.someOtherCall(123))
self:assertEquals('other expected value', myModule.someOtherCall(456))
end
]]--
return suite