Jump to content

Module:Sandbox/isaacl/ExpandPageAbbreviation/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by TheDJ (talk | contribs) at 12:26, 21 March 2013 (TheDJ moved page Module:Sandbox/isaacl/ExpandPageAbbreviation/tests to Module:Sandbox/isaacl/ExpandPageAbbreviation/testcases without leaving a redirect: Let's keep the same name we use in Template namespaces.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- Unit test cases for [[Module:Sandbox/isaacl/ExpandPageAbbreviation]].
-- Click on talk page to run tests.

local p = require('Module:UnitTests')

function p:test_WPN()
    -- test abbreviations that are expanded
    self:preprocess_equals('{{#invoke:Sandbox/isaacl/ExpandPageAbbreviation|expand|WP:N}}',
        "[[WP:N|Wikipedia's standards for inclusion]] (WP:N)")
    self:preprocess_equals('{{#invoke:Sandbox/isaacl/ExpandPageAbbreviation|expand|WP:NOTNEWS}}',
        '[[WP:NOTNEWS|Wikipedia is not a place for news coverage]] (WP:NOTNEWS)')

    -- test output cache by repeating some previous tests
    self:preprocess_equals('{{#invoke:Sandbox/isaacl/ExpandPageAbbreviation|expand|WP:N}}',
        "[[WP:N|Wikipedia's standards for inclusion]] (WP:N)")

    -- test abbreviations that are not expanded
    self:preprocess_equals('{{#invoke:Sandbox/isaacl/ExpandPageAbbreviation|expand|WP:NSPORTS}}',
        '[[WP:NSPORTS]]')
end

return p