Module:Wd/sandbox/testcases/testcaseTable
-- work in progress
-- This is going to contain centralized testcases, which are currently triplicated.
-- dependencies used for generating expected outputs
local wdib = require("Module:WikidataIB")
local wd = require("Module:Wd") -- temporary, should be converted to wdib
return {
-- structure: tables, which contain test inputs for the module and corresponding correct outputs
-- and, optionally, a boolean indicating if the testcase is to be inclosed in <ul> and </ul>
{"label|raw|page=Crosslauf-Europameisterschaften 2009|globalSiteId=dewiki", "Q1141358"},
-- These testcases were copied from the old testcase files (Module:wd/testcases/[1, 2, 3]).
-- In the previous version, all testcases with the "format" parameter lacked it when comparing outputs of sandbox against the main module (Module:wd/testcases/3).
{"property|Q55|P395", wdib._getValue{"P395",qid="Q55",noicon="true",osd="no",rank="best",maxvals="1",fwd="ALL"}},
{"property|P395", ""},
{"property|eid=Q55|P395", wdib._getValue{"P395",qid="Q55",noicon="true",osd="no",rank="best",maxvals="1",fwd="ALL"}},
{"property|eid=|P395", ""},
{"property|" .. wd._title{"Q55"} .. "|P395", ""},
{"property|:" .. wd._title{"Q55"} .. "|P395", wdib._getValue{"P395",qid="Q55",noicon="true",osd="no",rank="best",maxvals="1",fwd="ALL"}},
{"property|page=" .. wd._title{"Q55"} .. "|P395", wdib._getValue{"P395",qid="Q55",noicon="true",osd="no",rank="best",maxvals="1",fwd="ALL"}},
{"property|page=:" .. wd._title{"Q55"} .. "|P395", wdib._getValue{"P395",qid="Q55",noicon="true",osd="no",rank="best",maxvals="1",fwd="ALL"}},
{"property|page=|P395", ""},
{"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]]"},
{"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>"},
{"property|eid=Q55|Q2|P31", wdib._getValue{"P31",qid="Q2",linked="false",noicon="true",osd="no",rank="best",maxvals="1",fwd="ALL"}},
{"property|page=" .. wd._title{"Q55"} .. "|Q2|P31", wdib._getValue{"P31",qid="Q2",linked="false",noicon="true",osd="no",rank="best",maxvals="1",fwd="ALL"}},
{"property|page=" .. wd._title{"Q55"} .. "|eid=Q2|P31", wdib._getValue{"P31",qid="Q2",linked="false",noicon="true",osd="no",rank="best",maxvals="1",fwd="ALL"}},
{'property|P625|P31', ''},
{'property|Property:P625|P31', wdib._getValue{'P31',qid='P625',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}},
{'property|eid=P625|P31', wdib._getValue{'P31',qid='P625',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}},
{'property|eid=Property:P625|P31', wdib._getValue{'P31',qid='P625',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}},
{'property|coord|P31', ''},
{'property|Property:coord|P31', wdib._getValue{'P31',qid='P625',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}},
{'property|eid=coord|P31', wdib._getValue{'P31',qid='P625',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}},
{'property|eid=Property:coord|P31', wdib._getValue{'P31',qid='P625',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}},
{'property|invalid|P31', ''},
{'property|Property:invalid|P31', ''},
{'property|eid=invalid|P31', ''},
{'property|eid=Property:invalid|P31', ''},
{'property|normal+|Q55|P1082', wdib._getValue{'P1082',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}},
{'properties|normal+|Q55|P1082', table.concat({wdib._getValue{'P1082',qid='Q55',noicon='true',osd='no',rank='p',fwd='ALL'}, wdib._getValue{'P1082',qid='Q55',noicon='true',osd='no',rank='n',fwd='ALL'}}, ', ')},
{'properties|qualifier|normal+|Q55|P1082|P585|format=%p[ (%q)][%s][%r]', table.concat({wdib._getValue{'P1082',qid='Q55',qual='P585',noicon='true',osd='no',df='dmy',rank='p',fwd='ALL'}, wdib._getValue{'P1082',qid='Q55',qual='P585',noicon='true',osd='no',df='dmy',rank='n',fwd='ALL'}}, ', ')},
{'property|Q55|P1082', wdib._getValue{'P1082',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}},
{'property|Q55|P1082|punc=.', wdib._getValue{'P1082',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}..'.'},
-- this testcase was originally present only in Module:wd/testcases/3
{'properties|qualifier|normal+|Q55|P1082|P585|format=<li>%p[%r][<ul><li>%q</li></ul>]</li>', '', true},
}
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.