From 0aab3b10f014c4d7350d4a7333b34ffc7c0f1e4e Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Fri, 24 Mar 2006 17:10:43 +0000 Subject: [PATCH] Collected updates: * Always use example.com as domain in tests * disabled invalid-char test, the invalid char seems to have gone missing * Add test for External links: wiki links within external link (Bug 3695) * extended test for Bug 2702: Mismatched , and tags are invalid * there should be no more empty and tags in the output * Link to image page- image page normally doesn't exists, hence edit link * update all section edit texts to use new link title format * update fixed tests for invalid html in title/alt attributes (Bug 1887), add extra tests for this * Fix typo in Cat link * add test for fixed Bug 2095: link with pipe and three closing brackets * update test for html id validation --- maintenance/parserTests.txt | 154 +++++++++++++++++++++++++----------- 1 file changed, 107 insertions(+), 47 deletions(-) diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index c0d8f6f716..dabf177e8b 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -332,9 +332,9 @@ Definition list with URL link !! test Definition list with bracketed URL link !! input -;[http://www.google.com/ Google]:Number one search engine +;[http://www.example.com/ Example]:Something about it !! result -
Google
Number one search engine +
Example
Something about it
!! end @@ -669,6 +669,9 @@ BUG 289: literal double quote in bracketed URL !! test External links: invalid character +Fixme: the missing char seems to have gone missing +'' options +disabled !! input [http://www.example.com test] !! result @@ -685,6 +688,15 @@ External links: multiple legal whitespace is fine, Magnus. Don't break it please

!! end +!! test +External links: wiki links within external link (Bug 3695) +!! input +[http://example.com [[wikilink]] embedded in ext link] +!! result +

wikilink embedded in ext link +

+!! end + !! test BUG 787: Links with one slash after the url protocol are invalid !! input @@ -698,11 +710,19 @@ http:/example.com !! end !! test -Bug 2702: Mismatched and tags are invalid +Bug 2702: Mismatched , and tags are invalid !! input ''[http://example.com text''] +[http://example.com '''text]''' +''Something [http://example.com in italic''] +''Something [http://example.com mixed''''', even bold]''' +'''''Now [http://example.com both'''''] !! result -

text +

text +text +Something in italic +Something mixed, even bold +Now both

!! end @@ -833,7 +853,7 @@ Normal text.

Bold italic text with bold deactivated in between.

Bold italic text with italic deactivated in between.

Bold text.. -

..spanning two paragraphs (should not work). +

..spanning two paragraphs (should not work).

Bold tag left open

Italic tag left open

Normal text. @@ -869,10 +889,8 @@ A table with nothing but a caption !! result - -
caption -
-
+ + !! end !! test @@ -2421,11 +2439,13 @@ Image with frame and link !! end !! test -Link to image page +Link to image page- image page normally doesn't exists, hence edit link +TODO: Add test with existing image page +#

Image:test !! input [[:Image:test]] !! result -

Image:test +

Image:test

!! end @@ -2452,15 +2472,47 @@ BUG 1887: A ISBN with a thumbnail !! input [[Image:foobar.jpg|thumb|ISBN 12354]] !! result - + + +!! end + +!! test +BUG 1887: A RFC with a thumbnail +!! input +[[Image:foobar.jpg|thumb|This is RFC 12354]] +!! result +
This is RFC 12354
Enlarge
This is RFC 12354
+ +!! end + +!! test +BUG 1887: A mailto link with a thumbnail +!! input +[[Image:foobar.jpg|thumb|Please mailto:nobody@example.com]] +!! result + + +!! end + +!! test +BUG 1887: A with a thumbnail- we don't render math in the parsertests by default, +so math is not stripped and turns up as escaped <math> tags. +!! input +[[Image:foobar.jpg|thumb|2+2]] +!! result +
<math>2+2</math>
Enlarge
<math>2+2</math>
+ !! end !! test -BUG 1887: A with a thumbnail +BUG 1887, part 2: A with a thumbnail- math enabled +!! options +math !! input [[Image:foobar.jpg|thumb|2+2]] !! result -
2+2
Enlarge
<math>2+2<math>
+
2 + 2
Enlarge
2 + 2
+ !! end # Pending resolution to bug 368 @@ -2631,7 +2683,7 @@ Simple category !! options cat !! input -[[Category: MediaWiki User's Guide]] +[[Category:MediaWiki User's Guide]] !! result MediaWiki User's Guide !! end @@ -2667,13 +2719,13 @@ More ===Smaller headline=== Blah blah !! result -

Headline 1

+

Headline 1

Some text

-

Headline 2

+

Headline 2

More

-

Smaller headline

+

Smaller headline

Blah blah

!! end @@ -2713,16 +2765,15 @@ Some text - - -

Headline 1

-

Subheadline 1

-
Skipping a level
-
Skipping a level
-

Headline 2

+ +

Headline 1

+

Subheadline 1

+
Skipping a level
+
Skipping a level
+

Headline 2

Some text

-

Another headline

+

Another headline

!! end @@ -2769,19 +2820,17 @@ Handling of sections up to level 6 and beyond - -

-

-

Level 1 Heading

-

Level 2 Heading

-

Level 3 Heading

-

Level 4 Heading

-
Level 5 Heading
-
Level 6 Heading
-
= Level 7 Heading=
-
== Level 8 Heading==
-
=== Level 9 Heading===
-
==== Level 10 Heading====
+ +

Level 1 Heading

+

Level 2 Heading

+

Level 3 Heading

+

Level 4 Heading

+
Level 5 Heading
+
Level 6 Heading
+
= Level 7 Heading=
+
== Level 8 Heading==
+
=== Level 9 Heading===
+
==== Level 10 Heading====
!! end @@ -2793,8 +2842,8 @@ title=[[Parser test script]] == Foo bar == == Foo bar == !! result -

Foo bar

-

Foo bar

+

Foo bar

+

Foo bar

!! end @@ -2815,10 +2864,10 @@ __NOTOC__ {{sections}} ==Section 4== !! result -

Section 0

+

Section 0

Section 1

Section 2

-

Section 4

+

Section 4

!! end @@ -2841,7 +2890,7 @@ title=[[Parser test script]] !! input ==Section with a [[Main Page|link]] in it== !! result -

Section with a link in it

+

Section with a link in it

!! end @@ -3024,11 +3073,12 @@ Media link with text # FIXME: this is still bad HTML tag nesting !! test Media link with nasty text +fixme: doBlockLevels won't wrap this in a paragraph because it contains a div !! input [[Media:Foobar.jpg|Safe Link
" onmouseover="alert(document.cookie)" onfoo="
]] !! result -

Safe Link

-

+Safe Link<div style="display:none">" onmouseover="alert(document.cookie)" onfoo="</div> + !! end !! test @@ -3141,6 +3191,15 @@ Bug 2095: link with pipe and three closing brackets

!! end +!! test +Bug 2095: link with pipe and three closing brackets, version 2 +!! input +[[Main Page|[http://example.com/]]] +!! result +

[http://example.com/] +

+!! end + ### ### Safety @@ -3644,7 +3703,8 @@ Sanitizer: Validating the contents of the id attribute (bug 4515) !! input
!! result -Something, but defenetly not
... +


+

!! end TODO: -- 2.20.1