Module:Namespace detect/testcases: Difference between revisions

Content deleted Content added
test subject namespaces
tests for returning false
Line 1:
-- Example Unit tests for [[Module:Namespace detect]]. Click talk page to run tests.
local p = require('Module:UnitTests')
local nsDetect = require('Module:Namespace detect')._main
 
function p:test_template_testcases_page()
Line 234 ⟶ 235:
| page = Wikipedia talk:Foo]==]},
})
end
 
function p:test_returning_false()
self:equals('Return false from article', {page = 'Wikipedia', main = false}, false)
self:equals('Return false from talk page', {page = 'Talk:Wikipedia', main = true, talk = false}, false)
self:equals('Return false from category page', {page = 'Category:Wikipedians', main = true, talk = true, category = false}, false)
end