This site is supported by donations to The OEIS Foundation.

User:Daniel Forgues/Testcases

From OeisWiki
Jump to: navigation, search
Testcases
(Put code for template under test in /Sandbox.)


This is a OEIS Wiki user page.
This is not a OEIS Wiki article. If you find this page on any site other than OEIS Wiki, you are viewing a mirror site. Be aware that the page may be outdated and that the user to whom this page belongs may have no personal affiliation with any site other than OEIS Wiki itself. The original page is located at https://oeis.org/wiki/User:Daniel_Forgues/Testcases.


To get to the source wikitext code of a page or revision, use index.php thus

https://oeis.org/w/index.php?title=Prime_numbers&action=raw

Manual:Parameters_to_index.phpMediaWiki.org. (Passing action=raw returns the source wikitext code of a page or revision.)

Conditional comments

From: http://www.quirksmode.org/css/condcom.html

Conditional comments only work in IE, and are thus excellently suited to give special instructions meant only for IE. They are supported from IE 5 onwards.

The code:


:<span>
<!--[if IE]>
According to the conditional comment this is IE<br />
<![endif]-->
<!--[if IE 6]>
According to the conditional comment this is IE 6<br />
<![endif]-->
<!--[if IE 7]>
According to the conditional comment this is IE 7<br />
<![endif]-->
<!--[if IE 8]>
According to the conditional comment this is IE 8<br />
<![endif]-->
<!--[if IE 9]>
According to the conditional comment this is IE 9<br />
<![endif]-->
<!--[if gte IE 8]>
According to the conditional comment this is IE 8 or higher<br />
<![endif]-->
<!--[if lt IE 9]>
According to the conditional comment this is IE lower than 9<br />
<![endif]-->
<!--[if lte IE 7]>
According to the conditional comment this is IE lower or equal to 7<br />
<![endif]-->
<!--[if gt IE 6]>
According to the conditional comment this is IE greater than 6<br />
<![endif]-->
<!--[if !IE]> -->
According to the conditional comment this is not IE<br />
<!-- <![endif]-->
</span>

yields:

According to the conditional comment this is not IE

Magic words

Cf. Help:Magic wordsMediaWiki.org.

Cf. http://meta.wikimedia.org/wiki/Magic_word

Code Result Comment
{{SERVERNAME}} oeis.org  
{{SITENAME}} OeisWiki  
{{DISPLAYTITLE: User:Daniel Forgues/sandbox }} ("sandbox" in page title should show all in lowercase)
{{NAMESPACE}} User  
{{PAGENAME}} Daniel Forgues/Testcases  
{{BASEPAGENAME}} Daniel Forgues  
{{SUBPAGENAME}} Testcases  

Finding the User Agent?

Finding the User Agent via a magic word?

Code Result Comment
{{USERAGENT}} Template:USERAGENT (I wished, see Template:Vertical bar graph/bar#Bug.)
{{USER_AGENT}} Template:USER AGENT (I wished, see Template:Vertical bar graph/bar#Bug.)

Finding the User Agent via a conditional comment?

See #Conditional comments.

Parser functions

Code Result
{{lc: one TWO three}} one two three
{{lc: one Two three}} one two three
{{uc: one TWO three}} ONE TWO THREE
{{uc: one Two three}} ONE TWO THREE

{{PLURAL}}

Code Result Comments
a {{PLURAL: a|mouse|mice}} a mice WRONG!
the {{PLURAL: the|mouse|mice}} the mice WRONG!
many {{PLURAL: many|mouse|mice}} many mice  
-7 {{PLURAL: -7|mouse|mice}} -7 mice  
-1.7 {{PLURAL: -1.7|mouse|mice}} -1.7 mice  
-1 {{PLURAL: -1|mouse|mice}} -1 mouse  
-0.6 {{PLURAL: -0.6|mouse|mice}} -0.6 mice  
0 {{PLURAL: 0|mouse|mice}} 0 mice  
0.6 {{PLURAL: 0.6|mouse|mice}} 0.6 mice  
1 {{PLURAL: 1|mouse|mice}} 1 mouse  
1.0 {{PLURAL: 1.0|mouse|mice}} 1.0 mouse  
+1.0 {{PLURAL: +1.0|mouse|mice}} +1.0 mouse  
1.7 {{PLURAL: 1.7|mouse|mice}} 1.7 mice  
7 {{PLURAL: 7|mouse|mice}} 7 mice  

Extensions

Extension:StringFunctions

Extension:StringFunctionsMediaWiki.org.

Code Result
{{#len: one Two three}} 13
{{#len: one Two three }} 13
{{#pos: one Two three Two|Two}} 4
{{#pos: one Two three Two|Two|5}} 14
{{#pos: one Two three Two|one}} 0
{{#rpos: one Two three Two|Two}} 14