Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-140

Add ability to declare the same content for both an input and an expectation in the Rendering test framework

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • 3.2 RC1
    • 3.2 M2
    • None

    Description

      For example this allows to rewrite this:

      .#-----------------------------------------------------
      .input|xwiki/2.0
      .#-----------------------------------------------------
      This is ** bold **
      .#-----------------------------------------------------
      .expect|event/1.0
      .#-----------------------------------------------------
      beginDocument
      beginParagraph
      onWord [This]
      onSpace
      onWord [is]
      onSpace
      beginFormat [BOLD]
      onSpace
      onWord [bold]
      onSpace
      endFormat [BOLD]
      endParagraph
      endDocument
      .#-----------------------------------------------------
      .expect|xhtml/1.0
      .#-----------------------------------------------------
      <p>This is <strong>&nbsp;bold&nbsp;</strong></p>
      .#-----------------------------------------------------
      .expect|xwiki/2.0
      .#-----------------------------------------------------
      This is ** bold **
      .#-----------------------------------------------------
      .input|xhtml/1.0
      .#-----------------------------------------------------
      <p>This is <strong>&nbsp;bold&nbsp;</strong></p>
      .#-----------------------------------------------------
      .expect|docbook/4.4
      .#-----------------------------------------------------
      <?xml version="1.0"?><!DOCTYPE article PUBLIC "-//OASIS//DTD Simplified DocBook XML V1.1//EN" "http://www.oasis-open.org/docbook/xml/simple/1.1/sdocbook.dtd"><article><para>This is <emphasis role="bold"> bold </emphasis></para></article>
      .#-----------------------------------------------------
      .input|docbook/4.4
      .#-----------------------------------------------------
      <?xml version="1.0"?><!DOCTYPE article PUBLIC "-//OASIS//DTD Simplified DocBook XML V1.1//EN" "http://www.oasis-open.org/docbook/xml/simple/1.1/sdocbook.dtd"><article><para>This is <emphasis role="bold"> bold </emphasis></para></article>
      .#-----------------------------------------------------
      .expect|plain/1.0
      .#-----------------------------------------------------
      This is  bold 
      

      As:

      .#-----------------------------------------------------
      .inputexpect|xwiki/2.0
      .#-----------------------------------------------------
      This is ** bold **
      .#-----------------------------------------------------
      .expect|event/1.0
      .#-----------------------------------------------------
      beginDocument
      beginParagraph
      onWord [This]
      onSpace
      onWord [is]
      onSpace
      beginFormat [BOLD]
      onSpace
      onWord [bold]
      onSpace
      endFormat [BOLD]
      endParagraph
      endDocument
      .#-----------------------------------------------------
      .inputexpect|xhtml/1.0
      .#-----------------------------------------------------
      <p>This is <strong>&nbsp;bold&nbsp;</strong></p>
      .#-----------------------------------------------------
      .inputexpect|docbook/4.4
      .#-----------------------------------------------------
      <?xml version="1.0"?><!DOCTYPE article PUBLIC "-//OASIS//DTD Simplified DocBook XML V1.1//EN" "http://www.oasis-open.org/docbook/xml/simple/1.1/sdocbook.dtd"><article><para>This is <emphasis role="bold"> bold </emphasis></para></article>
      .#-----------------------------------------------------
      .expect|plain/1.0
      .#-----------------------------------------------------
      This is  bold 
      

      Pros:

      • Ensures that input and expect are 100% the same
      • Makes test smaller to read

      Attachments

        Activity

          People

            vmassol Vincent Massol
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: