From: Subramanya Sastry
Date: Mon, 24 Jun 2013 17:03:36 +0000 (-0500)
Subject: Added new + updated old tests for preventing regressions in Parsoid
X-Git-Tag: 1.31.0-rc.0~19366^2
X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=11b306fe5fd7d9d75731d37d069612bb6a3d9968;p=lhc%2Fweb%2Fwiklou.git
Added new + updated old tests for preventing regressions in Parsoid
Change-Id: I2963d8f2a91ec473eb7c9b063c4c5a4c2de8f82d
---
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index 5c3542176e..e03ac58441 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -3079,6 +3079,15 @@ External link containing double-single-quotes with no space separating the url f
!! end
+!! test
+External link with comments in link text
+!! input
+[http://www.google.com Google ]
+!! result
+Google
+
+!! end
+
!! test
URL-encoding in URL functions (single parameter)
!! input
@@ -3871,6 +3880,15 @@ Piped link
!! end
+!! test
+Piped link with comment in link text
+!! input
+[[Main Page|The Main Page]]
+!! result
+The Main Page
+
+!! end
+
!! test
Broken link
!! input
@@ -5053,6 +5071,33 @@ Single-comment whitespace lines dont break lists, but multi-comment whitespace l
!!end
+!!test
+Test the li-hack
+(Cannot test this with PHP parser since it relies on Tidy for the hack)
+!!options
+parsoid=wt2html,wt2wt
+!!input
+* foo
+* li-hack
+* {{echo|templated li-hack}}
+* unsupported li-hack with preceding comments
+
+
+!!result
+- foo
+- li-hack
+- templated li-hack
+-
- li-hack with preceding comments
+
+
+!!end
+
###
### Magic Words
###
@@ -14427,10 +14472,15 @@ Headings: 1. Nested inside html
parsoid
!! input
==foo==
+
===foo===
+
====foo====
+
=====foo=====
+
======foo======
+
=======foo=======
!! result
=foo=
@@ -14448,8 +14498,10 @@ parsoid
!! input
=foo=
*bar
+
=foo=
=bar
+
=foo=
=bar=
!! result
@@ -14474,12 +14526,19 @@ Headings: 4a. No escaping needed (testing just h1 and h2)
parsoid
!! input
==foo=
+
=foo==
+
= =foo= =
+
==foo= bar=
+
===foo==
+
==foo===
+
=''=''foo==
+
===
!! result
=foo
@@ -14513,10 +14572,15 @@ Headings: 5. Empty headings
parsoid
!! input
==
+
====
+
======
+
========
+
==========
+
============
!! result
@@ -14528,15 +14592,78 @@ parsoid
!!end
!! test
-Headings: 6. Heading chars in SOL context
+Headings: 6a. Heading chars in SOL context (with trailing spaces)
!! options
parsoid
!! input
-=h1=
- =h1=
!! result
-=h1=
- =h1=
+=a=
+=a=
+=a=
+=a=
+!!end
+
+!! test
+Headings: 6b. Heading chars in SOL context (with trailing newlines)
+!! options
+parsoid
+!! input
+=a=
+b
+
+=a=
+b
+
+=a=
+b
+
+=a=
+b
+!! result
+=a=
+b
+=a=
+b
+=a=
+b
+=a=
+b
+
+!!end
+
+!! test
+Headings: 6c. Heading chars in SOL context (leading newline break)
+!! options
+parsoid
+!! input
+a
+=b=
+!! result
+a
+=b=
+!!end
+
+!! test
+Headings: 6d. Heading chars in SOL context (with interspersed comments)
+!! options
+parsoid
+!! input
+=a=
+
+=a=
+!! result
+=a=
+=a=
+!!end
+
+!! test
+Headings: 6d. Heading chars in SOL context (No escaping needed)
+!! options
+parsoid=html2wt
+!! input
+=a=b
+!! result
+=a=b
!!end
#### --------------- Lists ---------------
@@ -14947,7 +15074,7 @@ disabled
!! end
-#### --------------- Links ---------------
+#### --------------- Links ----------------
#### 1. Quote marks in link text
#### 2. Wikilinks: Escapes needed
#### 3. Wikilinks: No escapes needed
@@ -15078,7 +15205,7 @@ parsoid
!! end
-#### --------------- Paragraphs ---------------
+#### ----------- Paragraphs ---------------
#### 1. No unnecessary escapes
#### --------------------------------------
@@ -15103,27 +15230,51 @@ bar [[foo]]
!!end
-#### --------------- PRE ------------------
-#### 1. Leading space in SOL context should be escaped
-#### --------------------------------------
+#### ----------------------- PRE --------------------------
+#### 1. Leading whitespace in SOL context should be escaped
+#### ------------------------------------------------------
!! test
-1. Leading space in SOL context should be escaped
+1. Leading whitespace in SOL context should be escaped
!! options
parsoid
!! input
- foo
- foo
+ a
+
+ a
+
+ a(tab)
+
+ a
+
+ a
+
+a
+ b
+
+a
+ b
+
+a
+ b
!! result
- foo
- foo
-
+ a
+ a
+ a(tab)
+ a
+ a
+a
+ b
+a
+ b
+a
+ b
!! end
#### --------------- HTML tags ---------------
#### 1. a tags
#### 2. other tags
#### 3. multi-line html tag
-#### --------------------------------------
+#### -----------------------------------------
!! test
1. a tags
!! options