Difference between revisions of "Template:Include-USGov/testcases"

From blackwiki
Jump to navigation Jump to search
imported>Hike395
(→‎Tests: add test)
imported>Shelbystripes
Line 39: Line 39:
 
|-
 
|-
 
| <nowiki>{{Include-USGov</nowiki><br/>
 
| <nowiki>{{Include-USGov</nowiki><br/>
<nowiki>|agency=United States Department</nowiki><br>
+
<nowiki>|agency=United States Department</nowiki><br/>
 
<nowiki>|url=http://www.agency.gov/}}</nowiki>
 
<nowiki>|url=http://www.agency.gov/}}</nowiki>
 
| {{Include-USGov|agency=United States Department|url=http://www.agency.gov}}
 
| {{Include-USGov|agency=United States Department|url=http://www.agency.gov}}
Line 46: Line 46:
 
|-
 
|-
 
| <nowiki>{{Include-USGov</nowiki><br/>
 
| <nowiki>{{Include-USGov</nowiki><br/>
<nowiki>|agency=United States Department</nowiki><br>
+
<nowiki>|agency=United States Department</nowiki><br/>
<nowiki>|url=http://www.agency.gov/}}</nowiki><br>
+
<nowiki>|url=http://www.agency.gov/}}</nowiki><br/>
 
<nowiki>|comment=comment}}</nowiki>
 
<nowiki>|comment=comment}}</nowiki>
 
| {{Include-USGov|agency=United States Department|url=http://www.agency.gov/|comment=comment}}
 
| {{Include-USGov|agency=United States Department|url=http://www.agency.gov/|comment=comment}}
Line 124: Line 124:
 
|{{Include-USGov/sandbox|agency=United States Department|article=Reference document|url=http://www.agency.gov/doc.html|source= }}
 
|{{Include-USGov/sandbox|agency=United States Department|article=Reference document|url=http://www.agency.gov/doc.html|source= }}
 
| Blank source leaves other parameters active
 
| Blank source leaves other parameters active
 +
|}
 +
 +
==Source parameter tests==
 +
 +
Test cases for using {{para|source}} parameter and {{tl|cite web}} embedded content:
 +
 +
{| class="wikitable"
 +
! Code
 +
! Working template
 +
! Sandbox version
 +
! Comments
 +
|-
 +
|<nowiki>{{Include-USGov</nowiki><br/>
 +
<nowiki>|agency=United States Department</nowiki><br/>
 +
<nowiki>|source=</nowiki><br/>
 +
:<nowiki>{{cite web</nowiki><br/>
 +
:<nowiki>|first=John</nowiki><br/>
 +
:<nowiki>|last=Smith</nowiki><br/>
 +
:<nowiki>|title=Battle of Hastings}}</nowiki><br/>
 +
<nowiki>}}</nowiki>
 +
|{{Include-USGov|agency=United States Department|source={{cite web|first=John |last=Smith |title=Battle of Hastings}} }}
 +
|{{Include-USGov/sandbox|agency=United States Department|source={{cite book|first=John |last=Smith |title=Battle of Hastings}} }}
 +
|Example of source usage from above table, changed from {{tl|cite book}} to {{tl|cite web}}
 +
|-
 +
|<nowiki>{{Include-USGov</nowiki><br/>
 +
<nowiki>|agency=United States Department</nowiki><br/>
 +
<nowiki>|source=</nowiki><br/>
 +
:<nowiki>{{cite web</nowiki><br/>
 +
:<nowiki>|first=John</nowiki><br/>
 +
:<nowiki>|last=Smith</nowiki><br/>
 +
:<nowiki>|title=Battle of Hastings</nowiki><br/>
 +
:<nowiki>|date=January 1, 2016}}</nowiki><br/>
 +
<nowiki>}}</nowiki>
 +
|{{Include-USGov|agency=United States Department|source={{cite web |first=John |last=Smith |title=Battle of Hastings |date=January 1, 2016}} }}
 +
|{{Include-USGov/sandbox|agency=United States Department|source={{cite web |first=John |last=Smith |title=Battle of Hastings |date=January 1, 2016}} }}
 +
|Example of source usage with {{para|date}} parameter in {{tl|cite web}} string
 +
|-
 +
|<nowiki>{{Include-USGov</nowiki><br/>
 +
<nowiki>|agency=United States Department</nowiki><br/>
 +
<nowiki>|source=</nowiki><br/>
 +
:<nowiki>{{cite web</nowiki><br/>
 +
:<nowiki>|first=John</nowiki><br/>
 +
:<nowiki>|last=Smith</nowiki><br/>
 +
:<nowiki>|title=Battle of Hastings</nowiki><br/>
 +
:<nowiki>|accessdate=February 29, 2016}}</nowiki><br/> 
 +
<nowiki>}}</nowiki>
 +
|{{Include-USGov|agency=United States Department|source={{cite web |first=John |last=Smith |title=Battle of Hastings |accessdate=February 29, 2016}} }}
 +
|{{Include-USGov/sandbox|agency=United States Department|source={{cite web |first=John |last=Smith |title=Battle of Hastings |accessdate=February 29, 2016}} }}
 +
|Example of source usage with {{para|accessdate}} parameter in {{tl|cite web}} string
 +
|-
 
|}
 
|}

Revision as of 06:08, 31 December 2017


  • 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
  • source (optional) - free field at end at shuts off most other arguments: useful for inline use of {{cite web}}

Tests

Code Working template Sandbox version Comments
{{Include-USGov

|agency=United States Department}}

 This article incorporates public domain material from websites or documents of the United States Department. File:PD-icon.svg 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
|policy=http://www.agency.gov/policy.html}}

File:PD-icon.svg This article incorporates public domain material from websites or documents of the United States Department. File:PD-icon.svg 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
|comment=comment can have [[Wikilink|link]]s}}

File:PD-icon.svg This article incorporates public domain material from websites or documents of the United States government. (comment can have links) File:PD-icon.svg 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
|url=http://www.agency.gov/}}

File:PD-icon.svg This article incorporates public domain material from the United States Department website http://www.agency.gov. File:PD-icon.svg This article incorporates public domain material from the United States Department website http://www.agency.gov. Url without agency is just a bare link
{{Include-USGov

|agency=United States Department
|url=http://www.agency.gov/}}
|comment=comment}}

File:PD-icon.svg This article incorporates public domain material from the United States Department website http://www.agency.gov/. (comment) File:PD-icon.svg This article incorporates public domain material from the United States Department website http://www.agency.gov/. (comment) Url with comment should still work
{{Include-USGov

|agency=United States Department
|article=Reference document}}

File:PD-icon.svg This article incorporates public domain material from the United States Department document: "Script error: No such module "If empty".". File:PD-icon.svg 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
|article=Reference document
|url=http://www.agency.gov/doc.html}}

File:PD-icon.svg This article incorporates public domain material from the United States Department document: "Reference document". File:PD-icon.svg 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
|article=Reference document
|url=http://www.agency.gov/doc.html
|author=John Q. Public}}

File:PD-icon.svg This article incorporates public domain material from the United States Department document: John Q. Public. "Reference document". File:PD-icon.svg 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
|article=Reference document
|url=http://www.agency.gov/doc.html
|accessdate=2008-08-08}}

File:PD-icon.svg This article incorporates public domain material from the United States Department document: "Reference document". Retrieved 2008-08-08. File:PD-icon.svg 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
|policy=http://www.agency.gov/policy.html
|article=Reference document
|url=http://www.agency.gov/doc.html
|author=John Q. Public
|accessdate=2008-08-08
|comment=comment can have [[Wikilink|link]]s}}

File:PD-icon.svg 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) File:PD-icon.svg 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
{{Include-USGov

|agency=United States government
|policy=http://www.whitehouse.gov
|author=Arglebargle IV
|article=On Boggies
|accessdate=Third Age
|source=Use cite template here}}

File:PD-icon.svg This article incorporates public domain material from the United States government document: Use cite template here File:PD-icon.svg This article incorporates public domain material from the United States government document: Use cite template here Source parameter shuts down most arguments, leaves free field at end for citation template
{{Include-USGov

|agency=United States Department
|source={{cite book|first=John |last=Smith |title=Battle of Hastings}} }}

File:PD-icon.svg This article incorporates public domain material from the United States Department document: Smith, John. Battle of Hastings. File:PD-icon.svg This article incorporates public domain material from the United States Department document: Smith, John. Battle of Hastings. Example of source usage
{{Include-USGov

|agency=United States Department
|article=Reference document
|url=http://www.agency.gov/doc.html
|source= }}

File:PD-icon.svg This article incorporates public domain material from the United States Department document: "Reference document". File:PD-icon.svg This article incorporates public domain material from the United States Department document: "Reference document". Blank source leaves other parameters active

Source parameter tests

Test cases for using |source= parameter and {{cite web}} embedded content:

Code Working template Sandbox version Comments
{{Include-USGov

|agency=United States Department
|source=

{{cite web
|first=John
|last=Smith
|title=Battle of Hastings}}

}}

File:PD-icon.svg This article incorporates public domain material from the United States Department document: Smith, John. "Battle of Hastings". Missing or empty |url= (help) File:PD-icon.svg This article incorporates public domain material from the United States Department document: Smith, John. Battle of Hastings. Example of source usage from above table, changed from {{cite book}} to {{cite web}}
{{Include-USGov

|agency=United States Department
|source=

{{cite web
|first=John
|last=Smith
|title=Battle of Hastings
|date=January 1, 2016}}

}}

File:PD-icon.svg This article incorporates public domain material from the United States Department document: Smith, John (January 1, 2016). "Battle of Hastings". Missing or empty |url= (help) File:PD-icon.svg This article incorporates public domain material from the United States Department document: Smith, John (January 1, 2016). "Battle of Hastings". Missing or empty |url= (help) Example of source usage with |date= parameter in {{cite web}} string
{{Include-USGov

|agency=United States Department
|source=

{{cite web
|first=John
|last=Smith
|title=Battle of Hastings
|accessdate=February 29, 2016}}

}}

File:PD-icon.svg This article incorporates public domain material from the United States Department document: Smith, John. "Battle of Hastings". Missing or empty |url= (help); |access-date= requires |url= (help) File:PD-icon.svg This article incorporates public domain material from the United States Department document: Smith, John. "Battle of Hastings". Missing or empty |url= (help); |access-date= requires |url= (help) Example of source usage with |accessdate= parameter in {{cite web}} string