From e07be1427ba6560fe8b08c720bfed9a2aa87f290 Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Tue, 30 Jul 2013 17:15:31 -0400 Subject: [PATCH] Sync up with Parsoid parserTests. This now aligns with Parsoid commit 4c47bd124c4cc860b53764b42a2af2581b429eb7 Change-Id: I48f936e6e8c456fd92297d55229e37a8ab3bb07f --- tests/parser/parserTests.txt | 174 ++++++++++++++++++++++++++++++++++- 1 file changed, 169 insertions(+), 5 deletions(-) diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 5e5931a201..76388d9b7d 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -6534,6 +6534,34 @@ Un-closed !! result !! end +# TODO: test with DOM fragment reuse! +!! test +Parsoid: DOM fragment reuse +!! options +parsoid=wt2wt,wt2html +!! input +a{{echo|b
c}}d + +a{{echo|b +
+c}}d + +{{echo|a + +
+ +b}} +!! result +ab +
cd +

ab

+
+

cd

+

a

+
+

b

+!! end + ### ### and in attributes ### @@ -7737,6 +7765,62 @@ But not inside includeonly {{subst:Foo}} !! end +!! test +Parsoid: Recognize nowiki with trailing space in tags +!! options +parsoid=wt2html +!! input +
[[foo]] + +ab + +cd + +ef +!! result +

<div>[[foo]]

+

ab

+

cd

+

ef

+!! end + +!! test +Parsoid: Recognize nowiki with odd capitalization +!! options +parsoid=wt2html +!! input +
[[foo]] +!! result +

<div>[[foo]]

+!! end + + +!! test +Parsoid: Escape nowiki with trailing space in tags +!! options +parsoid=html2wt +!! input +<nowiki > foo </nowiki > + +a<nowiki />b + +c<nowiki/ >d +!! result +

<nowiki > foo </nowiki >

+

a<nowiki />b

+

c<nowiki/ >d

+!! end + +!! test +Parsoid: Escape weird noWikI capitalizations +!! options +parsoid=html2wt +!! input +<noWikI > foo </NoWikI > +!! result +

<noWikI > foo </NoWikI >

+!! end + ### ### Message transform tests ### @@ -14987,7 +15071,7 @@ This should just get lost.

A [1] B [2]

-
  1. ↑ foo
  2. ↑ bar
+
  1. ↑ foo
  2. ↑ bar
!!end !!test @@ -15000,6 +15084,29 @@ parsoid
    !!end +!! test +References: 7. Multiple references tags (one without and one with nested refs) should be correctly handled +!! options +parsoid +!! input +A foo bar for a +B + + + + +foo + +!! result +

    A [1] +B [2]

    + +
    1. ↑ foo bar for a
    2. ↑
    + +
    1. ↑ foo
    + +!! end + #### ---------------------------------------------------------------- #### The following section of tests are primarily to test #### wikitext escaping capabilities of Parsoid. Given that @@ -15626,11 +15733,20 @@ parsoid |- |''foo''-bar |''foo''+bar +|- +|foo +bar|baz ++bar +-bar |} !! result +
    foo-barfoo+bar
    foo-barfoo+bar
    foo +

    bar|baz ++bar +-bar

    !! end @@ -15742,19 +15858,28 @@ parsoid #### 1. Quotes inside and #### 2. Link fragments separated by and tags #### 3. Link fragments inside and +#### 4. No escaping needed #### -------------------------------------- !! test 1. Quotes inside and +!! options +parsoid=html2wt,wt2wt !! input '''foo''' ''''foo'''' '''''foo''''' -''foo'''s +''foo'''s ''''foo'''' '''''foo''''' ''''''foo'''''' '''foo'''bar'''baz''' -'''foo''''s +'''foo''''s +'''foo'' +''foo''' +'''foo''' +''''foo''' +'''foo'''' +''''foo'''' !! result

    'foo' ''foo'' @@ -15765,7 +15890,12 @@ parsoid '''foo''' foo'bar'baz foo's -

    +'foo +foo' +'foo' +'foo +foo' +'foo'

    !! end !! test @@ -15781,7 +15911,7 @@ parsoid !! end !! test -2. Link fragments inside and +3. Link fragments inside and (FIXME: Escaping one or both of [[ and ]] is also acceptable -- this is one of the shortcomings of this format) !! input @@ -15794,6 +15924,17 @@ parsoid

    !! end +!! test +4. No escaping needed +!! input +'''bar''' +''''bar'''' +!! result +

    'bar' +'bar' +

    +!! end + #### ----------- Paragraphs --------------- #### 1. No unnecessary escapes #### -------------------------------------- @@ -15916,6 +16057,18 @@ Escaping nowikis

    <nowiki>foo</nowiki>

    !! end + +## The quote-char in the input is necessary for triggering the bug +!! test +(Bug 52035) Nowiki-escaping should not get tripped by " :" in text +!! options +parsoid=wt2wt,html2wt +!! input +foo's bar : +!! result +

    foo's bar :

    +!! end + !! test Tag-like HTML structures are passed through as text @@ -16275,6 +16428,17 @@ parsoid

    !!end +!!test +Encapsulate protected attributes from wt +!!options +parsoid +!!input +
    foo
    +!!result +
    foo
    + +!!end + # ----------------------------------------------------------------- # The following section of tests are primarily to spec requirements # around serialization of new/edited content. -- 2.20.1