Difference between revisions of "Template:Diff2/testcases"

From blackwiki
Jump to navigation Jump to search
imported>Amalthea
(testcases are a bit misleading with automatic link numbering, but please note that 2 and 4 currently produce different results!)
imported>Bsherr
m (as found, replacing Template:Tld with Template:Tlc or adding/updating category placement comments, plus general and typo fixes)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{template test cases notice}}
 +
 +
==Sandbox comparisons==
 
{{testcase
 
{{testcase
|id=1. revid
+
|id=1. oldid
 
|<nowiki>X{{diff2        |123}}X</nowiki>
 
|<nowiki>X{{diff2        |123}}X</nowiki>
 
|        X{{diff2        |123}}X
 
|        X{{diff2        |123}}X
Line 7: Line 10:
  
 
{{testcase
 
{{testcase
|id=2. revid & title
+
|id=2. oldid & label
 
|<nowiki>X{{diff2        |123|Foo}}X</nowiki>
 
|<nowiki>X{{diff2        |123|Foo}}X</nowiki>
 
|        X{{diff2        |123|Foo}}X
 
|        X{{diff2        |123|Foo}}X
Line 14: Line 17:
  
 
{{testcase
 
{{testcase
|id=3. revid & anchor & title
+
|id=3. oldid & section anchor & label
 
|<nowiki>X{{diff2        |123|Foo|Bar}}X</nowiki>
 
|<nowiki>X{{diff2        |123|Foo|Bar}}X</nowiki>
 
|        X{{diff2        |123|Foo|Bar}}X
 
|        X{{diff2        |123|Foo|Bar}}X
Line 21: Line 24:
  
 
{{testcase
 
{{testcase
|id=4. revid & anchor & empty title
+
|id=4. oldid & section anchor & empty label
 
|<nowiki>X{{diff2        |123|Foo|}}X</nowiki>
 
|<nowiki>X{{diff2        |123|Foo|}}X</nowiki>
 
|        X{{diff2        |123|Foo|}}X
 
|        X{{diff2        |123|Foo|}}X
Line 28: Line 31:
  
 
{{testcase
 
{{testcase
|id=5. revid & empty anchor & title
+
|id=5. oldid & empty section anchor & label
 
|<nowiki>X{{diff2        |123||Bar}}X</nowiki>
 
|<nowiki>X{{diff2        |123||Bar}}X</nowiki>
 
|        X{{diff2        |123||Bar}}X
 
|        X{{diff2        |123||Bar}}X
 
|        X{{diff2/sandbox|123||Bar}}X
 
|        X{{diff2/sandbox|123||Bar}}X
 
}}
 
}}
 +
 +
==Comparison of {{tlx|Diff2}}, {{tlx|Diff|&#124;}} and [[Special:Diff/prev/]]==
 +
===Examples using {{tlc|Diff2}}===
 +
{| class="wikitable"
 +
! Code
 +
! Output
 +
|-
 +
| {{tlx|Diff2|123456789}}
 +
| {{Diff2|123456789}}
 +
|-
 +
| {{tlx|Diff2|123456789|SomeUser's edit to "Some article name"}}
 +
| {{Diff2|123456789|SomeUser's edit to "Some article name"}}
 +
|-
 +
| {{tlx|Diff2|123456789|External links|SomeUser's edit to "Some article name"}}
 +
| {{Diff2|123456789|External links|SomeUser's edit to "Some article name"}}
 +
|-
 +
| {{tlx|Diff2|123456789|External links|<nowiki></nowiki>}}
 +
| {{Diff2|123456789|External links|}}
 +
|}
 +
 +
===Examples using {{tlc|Diff}} and empty page parameter===
 +
{| class="wikitable"
 +
! Code
 +
! Output
 +
|-
 +
| {{tlx|Diff|&#124;123456789}}
 +
| {{Diff||123456789}}
 +
|-
 +
| {{tlx|Diff|&#124;123456789|SomeUser's edit to "Some article name"}}
 +
| {{Diff||123456789|SomeUser's edit to "Some article name"}}
 +
|-
 +
| {{tlx|Diff|&#124;123456789|External links|SomeUser's edit to "Some article name"}}
 +
| {{Diff||123456789|External links|SomeUser's edit to "Some article name"}}
 +
|-
 +
| {{tlx|Diff|&#124;|123456789|External links|<nowiki></nowiki>}}
 +
| {{Diff||123456789|External links|}}
 +
|}
 +
 +
===Examples using [[Special:Diff//prev]]===
 +
{| class="wikitable"
 +
! Code
 +
! Output
 +
|-
 +
| <code><nowiki>[[Special:Diff/123456789/prev]]</nowiki></code>
 +
| [[Special:Diff/123456789/prev]]
 +
|-
 +
| <code><nowiki>[[Special:Diff/123456789/prev|SomeUser's edit to "Some article name"]]</nowiki></code>
 +
| [[Special:Diff/123456789/prev|SomeUser's edit to "Some article name"]]
 +
|-
 +
| <code><nowiki>[[Special:Diff/123456789/prev#External links|SomeUser's edit to "Some article name"]]</nowiki></code>
 +
| [[Special:Diff/123456789/prev#External links|SomeUser's edit to "Some article name"]]
 +
|-
 +
| <code><nowiki>[[Special:Diff/123456789/prev#External links]]</nowiki></code>
 +
| [[Special:Diff/123456789/prev#External links]]
 +
|}

Latest revision as of 23:13, 9 August 2020

Sandbox comparisons

Template:Testcase

Template:Testcase

Template:Testcase

Template:Testcase

Template:Testcase

Comparison of {{Diff2}}, {{Diff||}} and Special:Diff/prev/

Examples using {{Diff2}}

Code Output
{{Diff2|123456789}} [1]
{{Diff2|123456789|SomeUser's edit to "Some article name"}} SomeUser's edit to "Some article name"
{{Diff2|123456789|External links|SomeUser's edit to "Some article name"}} SomeUser's edit to "Some article name"
{{Diff2|123456789|External links|}} [2]

Examples using {{Diff}} and empty page parameter

Code Output
{{Diff||123456789}} [3]
{{Diff||123456789|SomeUser's edit to "Some article name"}} edit to "Some article name"
{{Diff||123456789|External links|SomeUser's edit to "Some article name"}} links SomeUser's edit to "Some article name"
{{Diff|||123456789|External links|}} links

Examples using Special:Diff//prev

Code Output
[[Special:Diff/123456789/prev]] Special:Diff/123456789/prev
[[Special:Diff/123456789/prev|SomeUser's edit to "Some article name"]] SomeUser's edit to "Some article name"
[[Special:Diff/123456789/prev#External links|SomeUser's edit to "Some article name"]] SomeUser's edit to "Some article name"
[[Special:Diff/123456789/prev#External links]] Special:Diff/123456789/prev#External links