Module:Wd/testcases/3

-- Unit tests for Module:Wd. Click talk page to run tests. local p = require('Module:UnitTests') local wd = require('Module:Wd') local wdsb = require('Module:Wd/sandbox')

function p:test_sandbox_vs_live self:preprocess_equals('', wd._property{'Q55','P395'}) self:preprocess_equals('', wd._property{'P395'}) self:preprocess_equals('', wd._property{eid='Q55','P395'}) self:preprocess_equals(, wd._property{eid=,'P395'}) self:preprocess_equals('', wd._property{wd._title{'Q55'},'P395'}) self:preprocess_equals('', wd._property{':' .. wd._title{'Q55'},'P395'}) self:preprocess_equals('', wd._property{page=wd._title{'Q55'},'P395'}) self:preprocess_equals('', wd._property{page=':' .. wd._title{'Q55'},'P395'}) self:preprocess_equals(, wd._property{page=,'P395'}) self:preprocess_equals('', wd._property{'edit','Q55','P395'}) self:preprocess_equals('', wd._property{'edit@end','Q55','P395'}) self:preprocess_equals('', wd._property{eid='Q55','Q2','P31'}) self:preprocess_equals('', wd._property{page=wd._title{'Q55'},'Q2','P31'}) self:preprocess_equals('', wd._property{page=wd._title{'Q55'},eid='Q2','P31'}) self:preprocess_equals('', wd._property{'P625','P31'}) self:preprocess_equals('', wd._property{'Property:P625','P31'}) self:preprocess_equals('', wd._property{eid='P625','P31'}) self:preprocess_equals('', wd._property{eid='Property:P625','P31'}) self:preprocess_equals('', wd._property{'coord','P31'}) self:preprocess_equals('', wd._property{'Property:coord','P31'}) self:preprocess_equals('', wd._property{eid='coord','P31'}) self:preprocess_equals('', wd._property{eid='Property:coord','P31'}) self:preprocess_equals('', wd._property{'invalid','P31'}) self:preprocess_equals('', wd._property{'Property:invalid','P31'}) self:preprocess_equals('', wd._property{eid='invalid','P31'}) self:preprocess_equals('', wd._property{eid='Property:invalid','P31'}) self:preprocess_equals('', wd._property{'normal+','Q55','P1082'}) self:preprocess_equals('', wd._properties{'normal+','Q55','P1082'}) self:preprocess_equals('', wd._properties{'qualifier','normal+','Q55','P1082','P585'}) self:preprocess_equals('', wd._property{'Q55','P1082'}) self:preprocess_equals('', wd._property{'Q55','P1082',punc='.'}) self:preprocess_equals('&#x3c;ul&#x3e;&#x3c;/ul&#x3e;', '&#x3c;ul&#x3e;' .. wd._properties{'qualifier','normal+','Q55','P1082','P585',format='&#x3c;li&#x3e;%p[%r][&#x3c;ul&#x3e;&#x3c;li&#x3e;%q&#x3c;/li&#x3e;&#x3c;/ul&#x3e;]&#x3c;/li&#x3e;'} .. '&#x3c;/ul&#x3e;') self:preprocess_equals('', wd._qualifier{'normal+','Q55','P1082','P585'}) self:preprocess_equals('', wd._qualifier{'normal+','single','Q55','P1082','P585'}) self:preprocess_equals('', wd._qualifier{'Q55','P1082','16829289','P585'}) self:preprocess_equals('', wd._qualifier{'mdy','Q55','P1082','16829289','P585'}) self:preprocess_equals('', wd._qualifier{'raw','Q55','P1082','16829289','P585'}) self:preprocess_equals('', wd._references{'raw','Q55','P1082','16829289'}) self:preprocess_equals('', wd._properties{'normal+','Q55','P1081'}) self:preprocess_equals('', wd._properties{'normal+','sourced','Q55','P1081'}) self:preprocess_equals('', wd._qualifier{'Q55','P2855','P518'}) self:preprocess_equals('', wd._qualifiers{'Q55','P2855','P518'}) self:preprocess_equals('', wd._properties{'qualifiers','Q55','P2855','P518'}) self:preprocess_equals(, wd._properties{'qualifiers','Q55','P2855','P518',sep='_+_',['sep%s']=,['sep%q']='_/_'}) self:preprocess_equals('', wd._properties{'qualifier','qualifier','normal+','Q55','P35','P580','P582'}) self:preprocess_equals('', wd._properties{'qualifier','qualifier','normal+','Q55','P35','P580','P582',['sep%q']='_–_'}) self:preprocess_equals('', wd._properties{'qualifier','qualifier','normal+','Q55','P35','P580','P582',format='%p[ &#x3c;span style="font-size:85\\%"&#x3e;(%q1[ – %q2])&#x3c;/span&#x3e;][%s][%r]'}) self:preprocess_equals('', wd._properties{'qualifier','qualifier','normal+','Q55','P35','P580','P582',format='%p[ &#x3c;span style="font-size:85\\%"&#x3e;([&#x3c;![]--%q2]since [%q2--[]&#x3e;]%q1[ – %q2])&#x3c;/span&#x3e;][%s][%r]'}) self:preprocess_equals('', wd._properties{'qualifier','raw','qualifier','normal+','Q55','P35','Q29574','P580','P582',format='%p[ &#x3c;span style="font-size:85\\%"&#x3e;(%q1[ – %q2])&#x3c;/span&#x3e;][%s][%r]'}) self:preprocess_equals('', wd._properties{'qualifiers','normal+','current','Q55','P38','P518'}) self:preprocess_equals('', wd._properties{'linked','qualifiers','normal+','current','Q55','P38','P518'}) self:preprocess_equals('', wd._properties{'qualifiers','linked','normal+','current','Q55','P38','P518'}) self:preprocess_equals('', wd._properties{'linked','short','qualifiers','linked','normal+','current','Q55','P38','P518'}) self:preprocess_equals('', wd._qualifiers{'normal+','current','Q55','P38','Q4917','P518'}) self:preprocess_equals('', wd._properties{'normal+','current','Q55','P38',P518='Q27561'}) self:preprocess_equals('', wd._properties{'normal+','former','Q55','P38'}) self:preprocess_equals('', wd._properties{'raw','normal+','former','Q55','P38'}) self:preprocess_equals('', wd._properties{'raw','linked','normal+','former','Q55','P38'}) self:preprocess_equals('', wd._property{'Q55','P1549'}) self:preprocess_equals('', wd._property{'multilanguage','Q55','P1549',P407='Q36846'}) self:preprocess_equals('', wd._property{'Q55','P2884'}) self:preprocess_equals('', wd._property{'linked','Q55','P2884'}) self:preprocess_equals('', wd._property{'raw','Q55','P2884'}) self:preprocess_equals('', wd._property{'unit','Q55','P2884'}) self:preprocess_equals('', wd._property{'unit','raw','Q55','P2884'}) self:preprocess_equals('', wd._property{'Q55','P625'}) self:preprocess_equals('', wd._property{'linked','Q55','P625'}) self:preprocess_equals('', wd._property{'raw','Q55','P625'}) self:preprocess_equals('', wd._property{'Q55','coord'}) self:preprocess_equals('', wd._property{'linked','Q55','P41'}) self:preprocess_equals('', wd._property{'raw','Q55','P41'}) self:preprocess_equals('', wd._property{'raw',date='1700-05-06','Q55','P41'}) self:preprocess_equals('', wd._property{'raw',date='1700-05-06','former','Q55','P41'}) self:preprocess_equals('', wd._property{'raw','Q915684','P2534'}) self:preprocess_equals('&#x3c;ul&#x3e;&#x3c;/ul&#x3e;', '&#x3c;ul&#x3e;' .. wd._properties{'linked','qualifier','qualifier','raw','Q915684','P527','P416','P2534',format='&#x3c;li&#x3e;%p[ (%q)]&#x3c;/li&#x3e;'} .. '&#x3c;/ul&#x3e;') self:preprocess_equals('', wd._property{'linked','Q6256','P3896'}) self:preprocess_equals('', wd._label{'Q4917'}) self:preprocess_equals('', wd._label{'short','linked','Q4917'}) self:preprocess_equals('', wd._label{'P38'}) self:preprocess_equals('', wd._label{'linked','P38'}) self:preprocess_equals('', wd._label{'Q776'}) self:preprocess_equals('', wd._label{'linked','Q776'}) self:preprocess_equals('', wd._label{eid='Q776'}) self:preprocess_equals('', wd._label{':' .. wd._title{'Q776'}}) self:preprocess_equals('', wd._label{page=wd._title{'Q776'}}) self:preprocess_equals('', wd._label{page=':' .. wd._title{'Q776'}}) self:preprocess_equals('', wd._label{eid='Q776','Q2'}) self:preprocess_equals('', wd._label{page=wd._title{'Q776'},'Q2'}) self:preprocess_equals('', wd._label{page=wd._title{'Q776'},eid='Q2'}) self:preprocess_equals('', wd._label{}) self:preprocess_equals(, wd._label{eid=}) self:preprocess_equals('', wd._label{'raw'}) self:preprocess_equals('', wd._label{'raw','Q776'}) self:preprocess_equals('', wd._label{'raw','linked','Q776'}) self:preprocess_equals('', wd._label{'P625'}) self:preprocess_equals('', wd._label{'Property:P625'}) self:preprocess_equals('', wd._label{eid='P625'}) self:preprocess_equals('', wd._label{eid='Property:P625'}) self:preprocess_equals('', wd._label{'coord'}) self:preprocess_equals('', wd._label{'Property:coord'}) self:preprocess_equals('', wd._label{eid='coord'}) self:preprocess_equals('', wd._label{eid='Property:coord'}) self:preprocess_equals('', wd._label{'invalid'}) self:preprocess_equals('', wd._label{'Property:invalid'}) self:preprocess_equals('', wd._label{eid='invalid'}) self:preprocess_equals('', wd._label{eid='Property:invalid'}) self:preprocess_equals('', wd._label{'raw','Q6'}) self:preprocess_equals('', wd._label{'raw','Q10000000000'}) self:preprocess_equals('', wd._label{'raw','P3'}) self:preprocess_equals('', wd._label{'raw','P10000000000'}) self:preprocess_equals('', wd._title{'Q776'}) self:preprocess_equals('', wd._title{'linked','Q776'}) self:preprocess_equals('', wd._title{}) self:preprocess_equals('', wd._description{'Q55'}) self:preprocess_equals('', wd._description{}) self:preprocess_equals('', wd._description{'Q6'}) self:preprocess_equals('', wd._description{'Q10000000000'}) self:preprocess_equals('', wd._description{'P3'}) self:preprocess_equals('', wd._description{'P10000000000'}) self:preprocess_equals('', wd._alias{'Q55'}) self:preprocess_equals('', wd._aliases{'Q55'}) self:preprocess_equals('', wd._alias{'linked','Q55'}) self:preprocess_equals('', wd._alias{}) self:preprocess_equals('', wd._badges{'Q2'}) self:preprocess_equals('', wd._badges{'raw','Q2'}) self:preprocess_equals('', wd._badges{}) end

return p