Template:Find sources/testcases
{{Testcases}}
Legacy tests
{{collapsible test case|_showcode=yes|_title=Default}}
{{collapsible test case|_showcode=yes|_title=Simple search|Albert Einstein}}
{{collapsible test case|_showcode=yes|_title=Complex search|Albert Einstein|physics|-"Marilyn Monroe"|relativity|science|free=yes}}
Group 2 – Using search term to change the default search
By default, the pagename is used as the argument to {{tl|find sources}}. This can be altered with the use of a search term after the first pipe.
{{Test case |_collapsible=yes |_showcode=yes |_format=columns |_title=Find sources – control: no params shows find sources using the pagetitle
}}
{{Test case |_collapsible=yes |_showcode=yes |_format=columns |_title=Find sources – with search term (5-word)
|United States embargo against Cuba}}
{{Test case |_collapsible=yes |_showcode=yes |_format=columns |_title=Find sources – with search term (6-word)
|Clandestine press of the French Resistance}}
{{Test case |_collapsible=yes |_showcode=yes |_format=columns |_title=Find sources – with search term (9-word)
|Collaboration with the Axis Powers during World War II}}
Group 3 – param 'domain'
{{Test case |_collapsible=yes |_showcode=yes |_format=columns |_title=3-1a. no params shows find general sources (the default)
}}
{{Test case |_collapsible=yes |_showcode=yes |_format=columns |_title=3-1b. no params shows find general sources (same)
|domain=}}
{{Test case |_collapsible=yes |_showcode=yes |_format=columns |_title=3-1c. domain=general (same)
|domain=general}}
{{Test case |_collapsible=yes |_showcode=yes |_format=columns |_title=3-1d. domain=gen (same)
|domain=gen}}
{{Test case |_collapsible=yes |_showcode=yes |_format=columns |_title=3-1e. invalid domain value (same)
|domain=FOO BAR}}
Article on medical topics get a different set of links generated by {{tl|find medical sources}} rather than the regular template.
{{Test case |_collapsible=yes |_showcode=yes |_format=columns |_title=3-2a. domain=medical: find medical sources
|domain=medical}}
{{Test case |_collapsible=yes |_showcode=yes |_format=columns |_title=3-2b. domain=med: find medical sources
|domain=med}}
----
{{Test case |_collapsible=yes |_showcode=yes |_format=columns |_title=3-2c. domain=med + 1 search term
|domain=med|giardiasis}}
{{Test case |_collapsible=yes |_showcode=yes |_format=columns |_title=3-2d. domain=med + 2 search terms
|domain=med|giardiasis|duodenalis}}
{{Test case |_collapsible=yes |_showcode=yes |_format=columns |_title=3-2e. domain=med + 3 search terms
|domain=med|giardiasis|duodenalis|NIH}}
{{Test case |_collapsible=yes |_showcode=yes |_format=columns |_title=3-2f. domain=med + 4 search terms
|domain=med|giardiasis|duodenalis|NIH|IL-6}}
{{Test case |_collapsible=yes |_showcode=yes |_format=columns |_title=3-3a. domain=video game: find video sources
|domain=video game}}
{{Test case |_collapsible=yes |_showcode=yes |_format=columns |_title=3-3b. domain=video: (same as above)
|domain=video}}
{{Test case |_collapsible=yes |_showcode=yes |_format=columns |_title=3-3c. domain=vg: (same as above)
|domain=vg}}
Group 4 – WikiProject autodetection
{{cot|bg=cornsilk|Expand to view description of how to run these tests}}
These tests rely on using {{tl|Talk header/sandbox}} transcluding the "Find sources" wrapper template ({{tl|Find sources/sandbox}} to choose the right domain-specific "find sources" template. Because these tests depend on using the WikiProjects listed in the Talk header template at the top of an article page, they cannot be tested in the normal way. You can either add a Talk header to the top of *this* page, and test in Preview mode, or test in Preview mode at the Talk pages of actual articles which have the appropriate Talk page headers and WikiProject listings. In the latter case, edit the Talk page header, find the transclusion of {{tlc|talk header}} (normally at the top of the page) and change it to {{tlc|talk header/sandbox}}, and observe the "find sources" links that are generated in each case. (If the page you're testing doesn't have a header, then just add {{tlc|talk header/sandbox}} at the top of the page, and Preview it.)
Any article Talk page with the correct header and projects may be used for this; the list below contains some suggested Talk pages with the correct WikiProjects on it to validate the test case. After viewing the test case result in Preview mode on the page, it's best to cancel out and not save the altered page.
; Articles including project Video games
⟶ Expected result: these should employ {{tl|find video games sources}} in Preview mode, after you've made the change described above:
- Talk:Darkwing Duck (Capcom video game)
- Talk:Illyriad
- Talk:Microsoft Flight Simulator (2020 video game)
; Articles including project Medicine
⟶ Expected result: these should employ {{tl|find medical sources}} in Preview mode, after you've made the change described above:
{{cot|bg=lightgreen|indent=0.8em|Autodetect for biographical articles is not implemented yet}}
; Articles including project Biography
⟶ Expected result: these should employ {{tl|find biographical sources}} in Preview mode, after you've made the change described above:
{{cob}}
; Articles that include combinations of projects{{snd}}medical & biographical:
Currently, pages linking both medical and biographical WikiProjects will show only medical source links by default.
; Other articles not including any of the projects above
⟶ Expected result: these should default to the standard {{tl|find sources}} list in Preview mode, after you've made the change described above; in other words, the same set of links will be present before and after the change:
(chosen from Special:Random)
{{cob}}
Group 5 – WikiProject override
{{cot|bg=cornsilk|Expand to view description of how to run these tests}}
As in group 4 (WikiProject autodetection) above, These tests rely on using {{tl|Talk header/sandbox}} transcluding the "Find sources" wrapper template ({{tl|Find sources/sandbox}} to choose the right domain-specific "find sources" template. Where it differs from group 4, is that in these tests, we include a {{para|domain}} param to override the WikiProject detected by the template. Read the instructions for Group 4 first, to understand how they are set up.
Because these tests depend on using the WikiProjects listed in the Talk header template at the top of an article page, they cannot be tested in the normal way. The best way to test this, is to add a Talk header with a {{para|domain}} param to the Talk pages of actual articles which have the appropriate Talk page headers and WikiProject listings (without saving):
- edit the Talk page header of an article belonging to, say, WikiProject medicine
- find the transclusion of {{tlc|talk header}} (normally at the top of the page)
- change it to (or add:) {{tlc|talk header/sandbox}}, hit Preview, and → take note of the "find sources" links that are generated
- execute a set of domain override tests on this page:
- change the header to {{tlc|talk header/sandbox|domain{{=}}video}} (or {{pval|vg}} or {{pval|video game}}) and Preview
- : ⟶ verify that the find sources links change to match those of {{tl|find video game sources}}
- change the header to {{tlc|talk header/sandbox|domain{{=}}general}} (or ({{pval|gen}}) and Preview
- : ⟶ verify that the find sources links change to match those of the default set: {{tl|find general sources}}
Any article Talk page may be used for these tests; the list below contains some suggested Talk pages with the correct WikiProjects on it to autodetect a project, and to override it using the {{para|domain}} param, and observe the results. After viewing the test case result in Preview mode on the page, it's best to just cancel out and not save the Previewed page.
Articles including project Video games
Expected result: unless the article also includes WikiProject Medicine, the header should employ {{tl|find video games sources}} in Preview mode with project autodetection. Adding {{para|domain|general}} or {{para|domain|medical}} should override that and provide general or medical source links instead:
- Talk:Darkwing Duck (Capcom video game)
- Talk:Illyriad
- Talk:Microsoft Flight Simulator (2020 video game)
Articles including project Medicine
Expected result: → these should employ {{tl|find medical sources}} in Preview mode with project autodetection, and adding {{para|domain|general}} or {{para|domain|video}} should override that and provide general or video game source links instead:
These articles don't belong to a WikiProject recognized for special handling by this template (they are chosen from Special:Random).
Expected result: these should default to the standard {{tl|find general sources}} list in Preview mode with project autodetection, and adding {{para|domain|medical}} or {{para|domain|video}} should override that and provide medical or video game source links instead:
{{cob}}
Group 6 – complex titles and param 'title'
- Subpages with parent pages should search just the last part after the (last) slash
- Slashes in article space are allowed, e.g. HIV/AIDS in Africa should search "HIV/AIDS in Africa".
- Pages with prefixes: namespace prefixes should be dropped (Wikpedia:, Talk:, etc)
- Pages with parenthetical disambiguation: in article space, add parendis as searchterm2; everywhere else, drop it
- Article: for Talk:John Smith (dentist), search "John Smith"+dentist+-wikipedia
- Talk:John Smith (anatomist and chemist), search "John Smith" +anatomist+and+chemist+-wikipedia
- Pages with parent and parenthetical disambiguation: use subpage only, add parendis as searchterm2 for articles only
- Pages with Prefix, parent, and parenthetical disambiguation: e.g.,
- Wikipedia:Articles for deletion/House Hippo (2nd nomination) search for "House Hippo"
- Test cases with {{para|title}}, for example: {{tlc|Find sources|title{{=}}House Hippo}}
- Retry with Contexttitle set to pages with combos of namespace prefix, subpage names, and parendis, such as 'Wikipedia:Articles for deletion/House Hippo (2nd nomination)'