Difference between revisions of "Template:Include-USGov/testcases"
imported>Hike395 (create tests from documentation) |
imported>Hike395 (test auto wiki linking) |
||
| Line 31: | Line 31: | ||
|- | |- | ||
| <nowiki>{{Include-USGov</nowiki><br/> | | <nowiki>{{Include-USGov</nowiki><br/> | ||
| − | <nowiki>|agency=United States | + | <nowiki>|agency=United States government</nowiki><br/> |
<nowiki>|comment=comment can have [[link]]s}}</nowiki> | <nowiki>|comment=comment can have [[link]]s}}</nowiki> | ||
| − | | {{Include-USGov|agency=United States | + | | {{Include-USGov|agency=United States government|comment=comment can have [[link]]s}} |
| − | | {{Include-USGov/sandbox|agency=United States | + | | {{Include-USGov/sandbox|agency=United States government|comment=comment can have [[link]]s}} |
| − | | comment is a free field that produces a parenthesized comment at end | + | | comment is a free field that produces a parenthesized comment at end, agency should auto-wikilink |
|- | |- | ||
| <nowiki>{{Include-USGov</nowiki><br/> | | <nowiki>{{Include-USGov</nowiki><br/> | ||
Revision as of 09:10, 30 December 2011
| 42px | This is the template test cases page for the sandbox of Template:Include-USGov. Script error: No such module "Purge". to update the examples. If there are many examples of a complicated template, later ones may break due to limits in MediaWiki, see the HTML comment "NewPP limit report" in the rendered page. You can also use Special:ExpandTemplates to examine the results of template uses. You can test how this page looks in the different skins with these links: |
- agency (required) - name of agency (or reference source) that produced material
- url (optional) - URL of reference
- policy (optional) - URL of re-use policy of agency or reference source
- comment (optional) - free field that produces parenthesized comment at end
- article (optional) - the title of the reference
- author (optional) - author of reference
- accessdate (optional) - date page last checked
Tests
| Code | Working template | Sandbox version | Comments |
|---|---|---|---|
| {{Include-USGov |agency=United States Department}} |
12px This article incorporates public domain material from websites or documents of the United States Department. | 12px This article incorporates public domain material from websites or documents of the United States Department. | Minimal usage: templates that call this one should pass in optional arguments. |
| {{Include-USGov |agency=United States Department |
12px This article incorporates public domain material from websites or documents of the United States Department. | 12px This article incorporates public domain material from websites or documents of the United States Department. | Replace internal wikilink about generic re-use to specific agency policy |
| {{Include-USGov |agency=United States government |
12px This article incorporates public domain material from websites or documents of the United States government. (comment can have links) | 12px This article incorporates public domain material from websites or documents of the United States government. (comment can have links) | comment is a free field that produces a parenthesized comment at end, agency should auto-wikilink |
| {{Include-USGov |agency=United States Department |
12px This article incorporates public domain material from the United States Department website http://www.agency.gov. | 12px This article incorporates public domain material from the United States Department website http://www.agency.gov. | Agency name becomes external link |
| {{Include-USGov |agency=United States Department |
12px This article incorporates public domain material from the United States Department document: "Script error: No such module "If empty".". | 12px This article incorporates public domain material from the United States Department document: "Script error: No such module "If empty".". | With article argument, template refers to specific document |
| {{Include-USGov |agency=United States Department |
12px This article incorporates public domain material from the United States Department document: "Reference document". | 12px This article incorporates public domain material from the United States Department document: "Reference document". | With article argument, url becomes external link to specific document |
| {{Include-USGov |agency=United States Department |
12px This article incorporates public domain material from the United States Department document: John Q. Public. "Reference document". | 12px This article incorporates public domain material from the United States Department document: John Q. Public. "Reference document". | Author can be added for use in inline citation |
| {{Include-USGov |agency=United States Department |
12px This article incorporates public domain material from the United States Department document: "Reference document". Retrieved 2008-08-08. | 12px This article incorporates public domain material from the United States Department document: "Reference document". Retrieved 2008-08-08. | Accessdate can be added, also |
| {{Include-USGov |agency=United States Department |
12px This article incorporates public domain material from the United States Department document: John Q. Public. "Reference document". Retrieved 2008-08-08. (comment can have links) | 12px This article incorporates public domain material from the United States Department document: John Q. Public. "Reference document". Retrieved 2008-08-08. (comment can have links) | All parameters can work together |
Test sandbox source parameter
- Test source=
{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY|source= |policy=POLICY |comment=COMMENT |article=ARTICLE |author=AUTHOR|accessdate=ACCESSDATE}}
- 12px This article incorporates [POLICY public domain material] from the AGENCY document: "Script error: No such module "If empty".". (COMMENT)
- test source=This is a test string
{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY |source=This is a test string |policy=POLICY |comment=COMMENT |author=AUTHOR|accessdate=ACCESSDATE}}
- 12px This article incorporates [POLICY public domain material] from the AGENCY document: This is a test string (COMMENT)
- test source={{cite book}}
{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY |source={{cite book|first=John |last=Smith |title=Battle of Hastings}} |policy=POLICY |comment=COMMENT |author=AUTHOR|accessdate=ACCESSDATE}}
- 12px This article incorporates [POLICY public domain material] from the AGENCY document: Smith, John. Battle of Hastings. (COMMENT)
Testing main template source parameter
- Test source=
- NO URL
{{ {{BASEPAGENAME}}|source=|agency=AGENCY |policy=POLICY |comment=COMMENT |article=ARTICLE |author=AUTHOR|accessdate=ACCESSDATE}}
- 12px This article incorporates [POLICY public domain material] from the AGENCY document: "Script error: No such module "If empty".". (COMMENT)
- NO URL
{{ {{BASEPAGENAME}}|source=1 | first=FIRST |last=LAST |title=TITLE |agency=AGENCY |policy=POLICY |comment=COMMENT |author=AUTHOR|accessdate=ACCESSDATE}}
- 12px This article incorporates [POLICY public domain material] from the AGENCY document: 1 (COMMENT)