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

From blackwiki
Jump to navigation Jump to search
imported>Hike395
(→‎Testing main template: rm url from no url caees)
imported>Hike395
(create tests from documentation)
Line 10: Line 10:
 
*    accessdate (optional) - date page last checked
 
*    accessdate (optional) - date page last checked
  
== Testing sandbox version ==
+
==Tests==
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>/sandbox}}</nowiki></code>
+
{| class="wikitable"
*{{{{BASEPAGENAME}}/sandbox}}
+
! Code
 +
! Working template
 +
! Sandbox version
 +
! Comments
 +
|-
 +
| <nowiki>{{Include-USGov</nowiki><br/>
 +
<nowiki>|agency=United States Department}}</nowiki>
 +
| {{Include-USGov|agency=United States Department}}
 +
| {{Include-USGov/sandbox|agency=United States Department}}
 +
| Minimal usage: templates that call this one should pass in optional arguments.
 +
|-
 +
| <nowiki>{{Include-USGov</nowiki><br/>
 +
<nowiki>|agency=United States Department</nowiki><br/>
 +
<nowiki>|policy=http://www.agency.gov/policy.html}}</nowiki>
 +
| {{Include-USGov|agency=United States Department|policy=http://www.agency.gov/policy.html}}
 +
| {{Include-USGov/sandbox|agency=United States Department|policy=http://www.agency.gov/policy.html}}
 +
| Replace internal wikilink about generic re-use to specific agency policy
 +
|-
 +
| <nowiki>{{Include-USGov</nowiki><br/>
 +
<nowiki>|agency=United States Department</nowiki><br/>
 +
<nowiki>|comment=comment can have [[link]]s}}</nowiki>
 +
| {{Include-USGov|agency=United States Department|comment=comment can have [[link]]s}}
 +
| {{Include-USGov/sandbox|agency=United States Department|comment=comment can have [[link]]s}}
 +
| comment is a free field that produces a parenthesized comment at end
 +
|-
 +
| <nowiki>{{Include-USGov</nowiki><br/>
 +
<nowiki>|agency=United States Department</nowiki></br>
 +
<nowiki>|url=http://www.agency.gov/}}</nowiki>
 +
| {{Include-USGov|agency=United States Department|url=http://www.agency.gov}}
 +
| {{Include-USGov/sandbox|agency=United States Department|url=http://www.agency.gov}}
 +
| Agency name becomes external link
 +
|-
 +
| <nowiki>{{Include-USGov</nowiki><br/>
 +
<nowiki>|agency=United States Department</nowiki><br/>
 +
<nowiki>|article=Reference document}}</nowiki>
 +
| {{Include-USGov|agency=United States Department|article=Reference document}}
 +
| {{Include-USGov/sandbox|agency=United States Department|article=Reference document}}
 +
| With article argument, template refers to specific document
 +
|-
 +
| <nowiki>{{Include-USGov</nowiki><br/>
 +
<nowiki>|agency=United States Department</nowiki><br/>
 +
<nowiki>|article=Reference document</nowiki><br/>
 +
<nowiki>|url=http://www.agency.gov/doc.html}}</nowiki>
 +
| {{Include-USGov|agency=United States Department|article=Reference document|url=http://www.agency.gov/doc.html}}
 +
| {{Include-USGov/sandbox|agency=United States Department|article=Reference document|url=http://www.agency.gov/doc.html}}
 +
| With article argument, url becomes external link to specific document
 +
|-
 +
| <nowiki>{{Include-USGov</nowiki><br/>
 +
<nowiki>|agency=United States Department</nowiki><br/>
 +
<nowiki>|article=Reference document</nowiki><br/>
 +
<nowiki>|url=http://www.agency.gov/doc.html</nowiki><br/>
 +
<nowiki>|author=John Q. Public}}</nowiki><br/>
 +
| {{Include-USGov|agency=United States Department|article=Reference document|url=http://www.agency.gov/doc.html|author=John Q. Public}}
 +
| {{Include-USGov/sandbox|agency=United States Department|article=Reference document|url=http://www.agency.gov/doc.html|author=John Q. Public}}
 +
| Author can be added for use in inline citation
 +
|-
 +
| <nowiki>{{Include-USGov</nowiki><br/>
 +
<nowiki>|agency=United States Department</nowiki><br/>
 +
<nowiki>|article=Reference document</nowiki><br/>
 +
<nowiki>|url=http://www.agency.gov/doc.html</nowiki><br/>
 +
<nowiki>|accessdate=2008-08-08}}</nowiki>
 +
| {{Include-USGov|agency=United States Department|article=Reference document|url=http://www.agency.gov/doc.html|accessdate=2008-08-08}}
 +
| {{Include-USGov/sandbox|agency=United States Department|article=Reference document|url=http://www.agency.gov/doc.html|accessdate=2008-08-08}}
 +
| Accessdate can be added, also
 +
|-
 +
| <nowiki>{{Include-USGov</nowiki><br/>
 +
<nowiki>|agency=United States Department</nowiki><br/>
 +
<nowiki>|policy=http://www.agency.gov/policy.html</nowiki><br/>
 +
<nowiki>|article=Reference document</nowiki><br/>
 +
<nowiki>|url=http://www.agency.gov/doc.html</nowiki><br/>
 +
<nowiki>|author=John Q. Public</nowiki><br/>
 +
<nowiki>|accessdate=2008-08-08</nowiki><br/>
 +
<nowiki>|comment=comment can have [[link]]s}}</nowiki><br/>
 +
| {{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 [[link]]s}}
 +
| {{Include-USGov/sandbox|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 [[link]]s}}
 +
| All parameters can work together
 +
|}
  
:<code><nowiki>{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY}}</nowiki></code>
 
*{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY}}
 
  
:<code><nowiki>{{ {{BASEPAGENAME}}/sandbox|url=http://www.whitehouse.gov}}</nowiki></code>
+
== Test sandbox source parameter ==
*{{ {{BASEPAGENAME}}/sandbox|url=http://www.whitehouse.gov}}
 
 
 
:<code><nowiki>{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY |url=http://www.whitehouse.gov}}</nowiki></code>
 
*{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY |url=http://www.whitehouse.gov}}
 
 
 
:<code><nowiki>{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY |url=http://www.whitehouse.gov |policy=POLICY}}</nowiki></code>
 
*{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY |url=http://www.whitehouse.gov |policy=POLICY}}
 
 
 
:<code><nowiki>{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY |url=http://www.whitehouse.gov |policy=POLICY |comment=COMMENT}}</nowiki></code>
 
*{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY |url=http://www.whitehouse.gov |policy=POLICY |comment=COMMENT}}
 
 
 
:<code><nowiki>{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY |url= |policy=POLICY |comment=COMMENT}}</nowiki></code>
 
*{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY |url=http://www.whitehouse.gov |policy=POLICY |comment=COMMENT}}
 
 
 
:<code><nowiki>{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY |url=http://www.whitehouse.gov |policy=POLICY |comment=COMMENT |article=ARTICLE}} </nowiki></code>
 
*{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY |url=http://www.whitehouse.gov |policy=POLICY |comment=COMMENT |article=ARTICLE}}
 
 
 
:<code><nowiki>{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY |url=http://www.whitehouse.gov |policy=POLICY |comment=COMMENT |article=ARTICLE |author=AUTHOR}} </nowiki></code>
 
*{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY |url=http://www.whitehouse.gov |policy=POLICY |comment=COMMENT |article=ARTICLE |author=AUTHOR}}
 
 
 
:NO URL <code><nowiki>{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY |policy=POLICY |comment=COMMENT |article=ARTICLE |author=AUTHOR|accessdate=ACCESSDATE}}</nowiki></code>
 
*{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY |policy=POLICY |comment=COMMENT |article=ARTICLE |author=AUTHOR|accessdate=ACCESSDATE}}
 
 
 
----
 
 
;Test source=
 
;Test source=
 
:<code><nowiki>{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY|source= |policy=POLICY |comment=COMMENT |article=ARTICLE |author=AUTHOR|accessdate=ACCESSDATE}} </nowiki></code>
 
:<code><nowiki>{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY|source= |policy=POLICY |comment=COMMENT |article=ARTICLE |author=AUTHOR|accessdate=ACCESSDATE}} </nowiki></code>
Line 54: Line 104:
 
*{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY |source={{cite book|first=John |last=Smith |title=Battle of Hastings}} |policy=POLICY |comment=COMMENT |author=AUTHOR|accessdate=ACCESSDATE}}
 
*{{ {{BASEPAGENAME}}/sandbox|agency=AGENCY |source={{cite book|first=John |last=Smith |title=Battle of Hastings}} |policy=POLICY |comment=COMMENT |author=AUTHOR|accessdate=ACCESSDATE}}
  
{{clear}}
+
== Testing main template source parameter ==
 
 
== Testing main template ==
 
 
 
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 
*{{ {{BASEPAGENAME}} }}
 
 
 
:<code><nowiki>{{ {{BASEPAGENAME}}|agency=AGENCY}}</nowiki></code>
 
*{{ {{BASEPAGENAME}}|agency=AGENCY}}
 
 
 
:<code><nowiki>{{ {{BASEPAGENAME}}|url=http://www.whitehouse.gov}}</nowiki></code>
 
*{{ {{BASEPAGENAME}}|url=http://www.whitehouse.gov}}
 
 
 
:<code><nowiki>{{ {{BASEPAGENAME}}|agency=AGENCY |url=http://www.whitehouse.gov}}</nowiki></code>
 
*{{ {{BASEPAGENAME}}|agency=AGENCY |url=http://www.whitehouse.gov}}
 
 
 
:<code><nowiki>{{ {{BASEPAGENAME}}|agency=AGENCY |url=http://www.whitehouse.gov |policy=POLICY}}</nowiki></code>
 
*{{ {{BASEPAGENAME}}|agency=AGENCY |url=http://www.whitehouse.gov |policy=POLICY}}
 
 
 
:<code><nowiki>{{ {{BASEPAGENAME}}|agency=AGENCY |url=http://www.whitehouse.gov |policy=POLICY |comment=COMMENT}}</nowiki></code>
 
*{{ {{BASEPAGENAME}}|agency=AGENCY |url=http://www.whitehouse.gov |policy=POLICY |comment=COMMENT}}
 
 
 
:<code><nowiki>{{ {{BASEPAGENAME}}|agency=AGENCY |url=http://www.whitehouse.gov |policy=POLICY |comment=COMMENT}}</nowiki></code>
 
*{{ {{BASEPAGENAME}}|agency=AGENCY |url=http://www.whitehouse.gov |policy=POLICY |comment=COMMENT}}
 
 
 
:<code><nowiki>{{ {{BASEPAGENAME}}|agency=AGENCY |url=http://www.whitehouse.gov |policy=POLICY |comment=COMMENT |article=ARTICLE}} </nowiki></code>
 
*{{ {{BASEPAGENAME}}|agency=AGENCY |url=http://www.whitehouse.gov |policy=POLICY |comment=COMMENT |article=ARTICLE}}
 
 
 
:<code><nowiki>{{ {{BASEPAGENAME}}agency=AGENCY |url=http://www.whitehouse.gov |policy=POLICY |comment=COMMENT |article=ARTICLE |author=AUTHOR}} </nowiki></code>
 
*{{ {{BASEPAGENAME}}|agency=AGENCY |url=http://www.whitehouse.gov |policy=POLICY |comment=COMMENT |article=ARTICLE |author=AUTHOR}}
 
 
 
:<code><nowiki>{{ {{BASEPAGENAME}}|agency=AGENCY |url=http://www.whitehouse.gov |policy=POLICY |comment=COMMENT |article=ARTICLE |author=AUTHOR|accessdate=ACCESSDATE}} </nowiki></code>
 
*{{ {{BASEPAGENAME}}|agency=AGENCY |url=http://www.whitehouse.gov |policy=POLICY |comment=COMMENT |article=ARTICLE |author=AUTHOR|accessdate=ACCESSDATE}}
 
 
 
:NO URL <code><nowiki>{{ {{BASEPAGENAME}}|agency=AGENCY |policy=POLICY |comment=COMMENT |article=ARTICLE |author=AUTHOR|accessdate=ACCESSDATE}} </nowiki></code>
 
*{{ {{BASEPAGENAME}}|agency=AGENCY |policy=POLICY |comment=COMMENT |article=ARTICLE |author=AUTHOR|accessdate=ACCESSDATE}}
 
  
----
 
 
;Test source=
 
;Test source=
 
:NO URL <code><nowiki>{{ {{BASEPAGENAME}}|source=|agency=AGENCY |policy=POLICY |comment=COMMENT |article=ARTICLE |author=AUTHOR|accessdate=ACCESSDATE}} </nowiki></code>
 
:NO URL <code><nowiki>{{ {{BASEPAGENAME}}|source=|agency=AGENCY |policy=POLICY |comment=COMMENT |article=ARTICLE |author=AUTHOR|accessdate=ACCESSDATE}} </nowiki></code>

Revision as of 08:48, 30 December 2011


  • 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}}

 This article incorporates public domain material from websites or documents of the United States Department.  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}}

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

 This article incorporates public domain material from websites or documents of the United States Department. (comment can have links)  This article incorporates public domain material from websites or documents of the United States Department. (comment can have links) comment is a free field that produces a parenthesized comment at end
{{Include-USGov

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

 This article incorporates public domain material from the United States Department website http://www.agency.gov.  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
|article=Reference document}}

 This article incorporates public domain material from the United States Department document: "Script error: No such module "If empty".".  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}}

 This article incorporates public domain material from the United States Department document: "Reference document".  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}}

 This article incorporates public domain material from the United States Department document: John Q. Public. "Reference document".  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}}

 This article incorporates public domain material from the United States Department document: "Reference document". Retrieved 2008-08-08.  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 [[link]]s}}

 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)  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}}
  •  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}}
  •  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}}
  •  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}}
  •  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}}
  •  This article incorporates [POLICY public domain material] from the AGENCY document: 1 (COMMENT)