View source for Module:Wd/testcases/2

Jump to navigation Jump to search

You do not have permission to edit this page, for the following reason:

The action you have requested is limited to users in the group: Users.

You can view and copy the source of this page.

-- Unit tests for [[Module:Wd]]. Click talk page to run tests.
local p = require('Module:UnitTests')
local wdib = require('Module:WikidataIB')
local wdsb = require('Module:Wd/sandbox')
function p:test_sandbox()
self:preprocess_equals('{{#invoke:wd/sandbox|property|Q55|P395}}', wdib._getValue{'P395',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
self:preprocess_equals('{{#invoke:wd/sandbox|property|P395}}', '')
self:preprocess_equals('{{#invoke:wd/sandbox|property|eid=Q55|P395}}', wdib._getValue{'P395',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
self:preprocess_equals('{{#invoke:wd/sandbox|property|eid=|P395}}', '')
self:preprocess_equals('{{#invoke:wd/sandbox|property|' .. wdsb._title{'Q55'} .. '|P395}}', '')
self:preprocess_equals('{{#invoke:wd/sandbox|property|:' .. wdsb._title{'Q55'} .. '|P395}}', wdib._getValue{'P395',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
self:preprocess_equals('{{#invoke:wd/sandbox|property|page=' .. wdsb._title{'Q55'} .. '|P395}}', wdib._getValue{'P395',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
self:preprocess_equals('{{#invoke:wd/sandbox|property|page=:' .. wdsb._title{'Q55'} .. '|P395}}', wdib._getValue{'P395',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
self:preprocess_equals('{{#invoke:wd/sandbox|property|page=|P395}}', '')
self:preprocess_equals('{{#invoke:wd/sandbox|property|edit|Q55|P395}}', wdib._getValue{'P395',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'} .. ' [[File:OOjs UI icon edit-ltr-progressive.svg|frameless|text-top|10px|alt=Edit this on Wikidata|link=https://www.wikidata.org/wiki/Q55?uselang=en#P395|Edit this on Wikidata]]')
self:preprocess_equals('{{#invoke:wd/sandbox|property|edit@end|Q55|P395}}', wdib._getValue{'P395',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'} .. '<span style="float:right">[[File:OOjs UI icon edit-ltr-progressive.svg|frameless|text-top|10px|alt=Edit this on Wikidata|link=https://www.wikidata.org/wiki/Q55?uselang=en#P395|Edit this on Wikidata]]</span>')
self:preprocess_equals('{{#invoke:wd/sandbox|property|eid=Q55|Q2|P31}}', wdib._getValue{'P31',qid='Q2',linked='false',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
self:preprocess_equals('{{#invoke:wd/sandbox|property|page=' .. wdsb._title{'Q55'} .. '|Q2|P31}}', wdib._getValue{'P31',qid='Q2',linked='false',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
self:preprocess_equals('{{#invoke:wd/sandbox|property|page=' .. wdsb._title{'Q55'} .. '|eid=Q2|P31}}', wdib._getValue{'P31',qid='Q2',linked='false',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
self:preprocess_equals('{{#invoke:wd/sandbox|property|P625|P31}}', '')
self:preprocess_equals('{{#invoke:wd/sandbox|property|Property:P625|P31}}', wdib._getValue{'P31',qid='P625',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
000
1:0
Debug console
* The module exports are available as the variable "p", including unsaved modifications. * Precede a line with "=" to evaluate it as an expression or use print(). Use mw.logObject() for tables. * Use mw.log() and mw.logObject() in module code to send messages to this console.

Return to Module:Wd/testcases/2.