From 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 12 Aug 2013 09:28:15 +0200 Subject: Update to MediaWiki 1.21.1 --- extensions/Cite/citeParserTests.txt | 449 ++++++++++++++++++++++++++++++++++++ 1 file changed, 449 insertions(+) create mode 100644 extensions/Cite/citeParserTests.txt (limited to 'extensions/Cite/citeParserTests.txt') diff --git a/extensions/Cite/citeParserTests.txt b/extensions/Cite/citeParserTests.txt new file mode 100644 index 00000000..ded8cc19 --- /dev/null +++ b/extensions/Cite/citeParserTests.txt @@ -0,0 +1,449 @@ +# Force the test runner to ensure the extension is loaded +!! hooks +ref +references +!! endhooks + +!! test +Simple , no +!! input +Wikipedia rocks!Proceeds of Rockology, vol. XXI +!! result +

Wikipedia rocks![1] +
Cite error: <ref> tags exist, but no <references/> tag was found +

+!! end + +!! test +Simple , with +!! input +Wikipedia rocks!Proceeds of Rockology, vol. XXI + + +!! result +

Wikipedia rocks![1] +

+
    +
  1. Proceeds of Rockology, vol. XXI +
  2. +
+ +!! end + + +!! article +Template:Simple template +!! text +A ''simple'' template. +!! endarticle + + +!! test + with a simple template +!! input +Templating{{simple template}} + + +!! result +

Templating[1] +

+
    +
  1. A simple template. +
  2. +
+ +!! end + +!! test + with a +!! input +Templating{{simple template}} + + +!! result +

Templating[1] +

+
    +
  1. {{simple template}} +
  2. +
+ +!! end + + +!! test + in a +!! input +Templating{{simple template}} + + +!! result +

Templating<ref>{{simple template}}</ref> +


+

+!! end + +!! test + in a +!! input +Templating + + +!! result +

Templating +


+

+!! end + +!! test + in a (bug 5384) +!! input +TemplatingText + + +!! result +

Templating[1] +

+
    +
  1. Text +
  2. +
+ +!! end + +!! test + after (bug 6164) +!! input +one + +Image:Foobar.jpg + + +!! result +

[1] +

+ +
    +
  1. one +
  2. +
+ +!! end + +!! test +{{REVISIONID}} on page with (bug 6299) +!! input +{{REVISIONID}}elite +!! result +

1337[1] +
Cite error: <ref> tags exist, but no <references/> tag was found +

+!! end + +!! test +{{REVISIONID}} on page without (bug 6299 sanity check) +!! input +{{REVISIONID}} +!! result +

1337 +

+!! end + +!! test +Blank ref followed by ref with content +!! input + + +content + + +!! result +

[1] +

[1] +

+
    +
  1. 1.0 1.1 content +
  2. +
+ +!! end + +!! test +Regression: non-blank ref "0" followed by ref with content +!! input +0 + +content + + +!! result +

[1] +

[1] +

+
    +
  1. 1.0 1.1 0 +
  2. +
+ +!! end + +!! test +Regression sanity check: non-blank ref "1" followed by ref with content +!! input +1 + +content + + +!! result +

[1] +

[1] +

+
    +
  1. 1.0 1.1 1 +
  2. +
+ +!! end + +!! test +Ref names containing a number +!! input +One +Two +Three + + +!! result +

[1] +[2] +[3] +

+
    +
  1. One +
  2. +
  3. Two +
  4. +
  5. Three +
  6. +
+ +!! end + +!! test +Erroneous refs +!! input +Zero + +Also zero, but differently! (Normal ref) + + + + + + + + + + +!! result +

Cite error: Invalid <ref> tag; +name cannot be a simple integer. Use a descriptive title +

[1] +

Cite error: Invalid <ref> tag; +refs with no content must have a name +

[2] +

[3] +

Cite error: Invalid <references> tag; +parameter "group" is allowed only. +Use <references />, or <references group="..." /> +

+
    +
  1. Also zero, but differently! (Normal ref) +
  2. +
  3. Cite error: Invalid <ref> tag; +no text was provided for refs named bar
  4. +
  5. Cite error: Invalid <ref> tag; +no text was provided for refs named blankwithnoreference
  6. +
+ +!! end + + +!! test +Simple , with in group +!! input +Wikipedia rocks!Proceeds of Rockology, vol. XXI +Wikipedia rocks!Proceeds of Rockology, vol. XXI + + + +!! result +

Wikipedia rocks![1] +Wikipedia rocks![note 1] +

+
    +
  1. Proceeds of Rockology, vol. XXI +
  2. +
+
    +
  1. Proceeds of Rockology, vol. XXI +
  2. +
+ +!! end + +!! test +Simple , with in group, with groupname in chinese +!! input +AAAref aBBBnote bCCCref c + +;refs + +;notes + +!! result +

AAA[参 1]BBB[注 1]CCC[参 2] +

+
refs +
+
    +
  1. ref a +
  2. +
  3. ref c +
  4. +
+
notes +
+
    +
  1. note b +
  2. +
+ +!! end + +!! test + defined in +!! input + + + +BAR + +!! result +

[1] +

+
    +
  1. BAR +
  2. +
+ +!! end + +!! test + defined in called with #tag +!! input + + +{{#tag:references| +BAR +}} +!! result +

[1] +

+
    +
  1. BAR +
  2. +
+ +!! end + +!! test + defined in error conditions +!! input + + + + +BAR +bad group +BAR BAR + +!! result +

[2 1] +

+
    +
  1. Cite error: Invalid <ref> tag; +no text was provided for refs named foo
  2. +
+

Cite error: <ref> tag with name "unused" defined in <references> is not used in prior text.
+Cite error: <ref> tag in <references> has conflicting group attribute "1".
+Cite error: <ref> tag defined in <references> has no name attribute. +

+!! end + +!! article +MediaWiki:cite_link_label_group-klingon +!! text +wa' cha' wej loS vagh jav Soch chorgh Hut wa'maH +!! endarticle + +!! test + with custom group link +!! input +Wikipedia rocks!Proceeds of Rockology, vol. XXI + + +!! result +

Wikipedia rocks![wa'] +

+
    +
  1. Proceeds of Rockology, vol. XXI +
  2. +
+ +!! end + +!! test +Bug 31374 regression check: nested strip items +!! input +{{#tag:ref|notereference|group=Note}} + + +!! result +

[Note 1] +

+
    +
  1. note[1] +
  2. +
+
    +
  1. reference +
  2. +
+ +!! end + +!! test +Bug 13073 regression check: wrapped +!! input + +foo + +
+!! result +

[1] +

+
    +
  1. +foo +
  2. +
+ +!! end -- cgit v1.2.3-54-g00ecf