Jump to content

Module:Wd/sandbox/testcases/testcaseTable

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Janhrach (talk | contribs) at 07:46, 29 August 2023 (Fixed my mistake). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- 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
    
    -- These testcases were copied from the old testcase files (Module:wd/testcases/[1, 2, 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", ""}
}