Content deleted Content added
Fred Gandt (talk | contribs) + more tests |
Fred Gandt (talk | contribs) + more tests |
||
Line 37:
function p:test_name_prefer_wikidata__explicit_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=Author, Author (Star Trek: Voyager)|prefer=
end
function p:test_name__conflicting__only_explicit_prefer_wikidata__explicit_exists()
return p▼
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=The Partisan|prefer=wikidata|only=explicit}}', "1943 song by Anna Marly and Emmanuel d'Astier, popularised by Leonard Cohen in 1969")
end
function p:test_name__conflicting__only_wikidata_prefer_explicit__explicit_exists()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=The Partisan|prefer=explicit|only=wikidata}}', "song composed by Anna Marly with lyrics by Emmanuel d'Astier de La Vigerie performed by Leonard Cohen")
end
function p:test_name__conflicting__only_explicit_prefer_wikidata__explicit_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=Author, Author (Star Trek: Voyager)|prefer=wikidata|only=explicit}}', "")
end
function p:test_name__conflicting__only_wikidata_prefer_explicit__explicit_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=Author, Author (Star Trek: Voyager)|prefer=explicit|only=wikidata}}', "episode of Star Trek: Voyager (S7 E20)")
end
function p:test_name_only_explict_fallback__explicit_exists()
self:preprocess_equals("{{#invoke:GetShortDescription|main|name=The Partisan|only=explicit|fallback=a song by Anna Marly and Emmanuel d'Astier}}", "1943 song by Anna Marly and Emmanuel d'Astier, popularised by Leonard Cohen in 1969")
end
function p:test_name_only_explict_fallback__explicit_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=Author, Author (Star Trek: Voyager)|only=explicit|fallback=an episode of Star Trek: Voyager}}', "an episode of Star Trek: Voyager")
end
-- Testing |lang_italic= |lang_nocat= |lang_size= |lang_cat= |lang_rtl= |lang_no= will require a wikidata description in a language other than English to be returned
▲return p
|