You can edit almost every page by Creating an account and confirming your email.

Module:Wd/testcases

From EverybodyWiki Bios & Wiki

Documentation for this module may be created at Module:Wd/testcases/doc

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

function p._test(frame)
	require('Module:Wd')--.property(frame)
	local t = { a = 5, b = 6, };
	loadSubmodules(frame)
	--loadSubmodules()
	return mw.dumpObject(copyTable(t)) .. "\n\n" ..
	frame:getTitle() .. "\n\n" ..
	errorText("unknown-data-type")
end

function p:test()
    self:preprocess_equals('{{#invoke:Wd|property }}', '')
    self:preprocess_equals('{{#invoke:Wd|property | hello}}', '')
    self:preprocess_equals('{{#invoke:Wd|_property }}', '')
    self:preprocess_equals('{{#invoke:Wd|_property | hello}}', '')
    self:preprocess_equals('{{#invoke:Wd/testcases|_test | hello}}', '')
    self:preprocess_equals('{{safesubst:#invoke:Wd|main|qualifier|property|P485|Q24568958|P856|eid=Q131333|format=\[%q %p\]}}', '')
    self:preprocess_equals('{{wikidata|qualifier|property|P485|Q24568958|P856|eid=Q131333|format=\[%q %p\]}}', '')
    self:preprocess_equals('{{safesubst:#invoke:Wd|main|qualifier|property|Q131333|P485|Q24568958|P856|format=\[%q %p\]}}', '')
    self:preprocess_equals('{{wikidata|qualifier|property|Q131333|P485|Q24568958|P856|format=\[%q %p\]}}', '')
    self:preprocess_equals('{{#invoke:wd|property|eid=Q55|P395}}', '')
    self:preprocess_equals('{{#invoke:Wd|qualifier|Q131333|P485|Q24568958|P856|format=\[%q %p\]}}', '')
    self:preprocess_equals('{{#invoke:Wd|qualifier|Q131333|P485|Q24568958|P856}}', '')
    self:preprocess_equals('{{#invoke:Wd|qualifier|Q131333|P485|P856}}', '')
    self:preprocess_equals('{{#invoke:wd|qualifier|Q55|P2855|P518}}', '')
end

return p

This module "Wd/testcases" is from Wikipedia if otherwise notified