Difference between revisions of "Template:Diff2/testcases"

From blackwiki
Jump to navigation Jump to search
imported>Salton Finneger
(Added test comparing template:diff2 with template:diff using a blank page name parameter (checking documentation claim that template:diff requires a page name.)
imported>Bsherr
m (as found, replacing Template:Tld with Template:Tlc or adding/updating category placement comments, plus general and typo fixes)
 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
==Comparison of {{tlx|Diff2}} and {{tlx|Diff||}}==
+
{{template test cases notice}}
===Examples using {{tld|Diff2}}===
+
 
 +
==Sandbox comparisons==
 +
{{testcase
 +
|id=1. oldid
 +
|<nowiki>X{{diff2        |123}}X</nowiki>
 +
|        X{{diff2        |123}}X
 +
|        X{{diff2/sandbox|123}}X
 +
}}
 +
 
 +
{{testcase
 +
|id=2. oldid & label
 +
|<nowiki>X{{diff2        |123|Foo}}X</nowiki>
 +
|        X{{diff2        |123|Foo}}X
 +
|        X{{diff2/sandbox|123|Foo}}X
 +
}}
 +
 
 +
{{testcase
 +
|id=3. oldid & section anchor & label
 +
|<nowiki>X{{diff2        |123|Foo|Bar}}X</nowiki>
 +
|        X{{diff2        |123|Foo|Bar}}X
 +
|        X{{diff2/sandbox|123|Foo|Bar}}X
 +
}}
 +
 
 +
{{testcase
 +
|id=4. oldid & section anchor & empty label
 +
|<nowiki>X{{diff2        |123|Foo|}}X</nowiki>
 +
|        X{{diff2        |123|Foo|}}X
 +
|        X{{diff2/sandbox|123|Foo|}}X
 +
}}
 +
 
 +
{{testcase
 +
|id=5. oldid & empty section anchor & label
 +
|<nowiki>X{{diff2        |123||Bar}}X</nowiki>
 +
|        X{{diff2        |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"
 
{| class="wikitable"
 
! Code
 
! Code
Line 18: Line 56:
 
|}
 
|}
  
===Examples using {{tld|Diff}} and empty page parameter===
+
===Examples using {{tlc|Diff}} and empty page parameter===
 
{| class="wikitable"
 
{| class="wikitable"
 
! Code
 
! Code
Line 36: Line 74:
 
|}
 
|}
  
==Prior content before {{tld|Diff2}} vs. {{tld|Diff}} comparison was added. ==
+
===Examples using [[Special:Diff//prev]]===
{{testcase
+
{| class="wikitable"
|id=1. revid
+
! Code
|<nowiki>X{{diff2        |123}}X</nowiki>
+
! Output
|       X{{diff2        |123}}X
+
|-
|        X{{diff2/sandbox|123}}X
+
| <code><nowiki>[[Special:Diff/123456789/prev]]</nowiki></code>
}}
+
| [[Special:Diff/123456789/prev]]
 
+
|-
{{testcase
+
| <code><nowiki>[[Special:Diff/123456789/prev|SomeUser's edit to "Some article name"]]</nowiki></code>
|id=2. revid & title
+
| [[Special:Diff/123456789/prev|SomeUser's edit to "Some article name"]]
|<nowiki>X{{diff2        |123|Foo}}X</nowiki>
+
|-
|       X{{diff2        |123|Foo}}X
+
| <code><nowiki>[[Special:Diff/123456789/prev#External links|SomeUser's edit to "Some article name"]]</nowiki></code>
|        X{{diff2/sandbox|123|Foo}}X
+
| [[Special:Diff/123456789/prev#External links|SomeUser's edit to "Some article name"]]
}}
+
|-
 
+
| <code><nowiki>[[Special:Diff/123456789/prev#External links]]</nowiki></code>
{{testcase
+
| [[Special:Diff/123456789/prev#External links]]
|id=3. revid & anchor & title
+
|}
|<nowiki>X{{diff2        |123|Foo|Bar}}X</nowiki>
 
|       X{{diff2        |123|Foo|Bar}}X
 
|        X{{diff2/sandbox|123|Foo|Bar}}X
 
}}
 
 
 
{{testcase
 
|id=4. revid & anchor & empty title
 
|<nowiki>X{{diff2        |123|Foo|}}X</nowiki>
 
|        X{{diff2        |123|Foo|}}X
 
|        X{{diff2/sandbox|123|Foo|}}X
 
}}
 
 
 
{{testcase
 
|id=5. revid & empty anchor & title
 
|<nowiki>X{{diff2        |123||Bar}}X</nowiki>
 
|       X{{diff2        |123||Bar}}X
 
|       X{{diff2/sandbox|123||Bar}}X
 
}}
 

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