Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DFDL-932

Write tests for Escape Scheme Scenarios

XMLWordPrintableJSON

    • Icon: Task Task
    • Resolution: Done
    • Icon: Normal Normal
    • s13
    • None
    • Infrastructure
    • None

      Create a single tdml file that contains the schema(s) and tests necessary to test the following escape scheme scenarios:

      EC = escapeCharacter
      EEC = escapeEscapeCharacter
      PTERM = delimiter

      Each line is a separate scenario. The first block is the input and the second is the expected output.

      > (EC=EEC)!=PTERM[1], EC=EEC=/ PTERM=;
      > foo;bar <x>foo</x><y>bar</y>
      > foo/bar <x>foobar</x>
      > foo/;bar <x>foo;bar</x>
      > foo//;bar <x>foo/;bar</x>
      > foo///bar <x>foo//bar</x> (Tricky!)
      > foo///;bar <x>foo/;bar</x>
      > foo; <x>foo</x> if PTERM is terminator or postfix sep. Parse Error otherwise.
      > foo/; <x>foo;</x> Parse error if PTERM is required terminating markup.
      > foo/;; <x>foo;</x> if PTERM is terminator or postfix sep. Parse Error otherwise
      > foo//; <x>foo/</x> if PTERM is terminator or postfix sep. Parse Error otherwise
      > foo///; <x>foo/;</x> (Tricky) if PTERM is infix separator or not-required terminator. Parse Error otherwise.
      > foo/ <x>foo</x> (Tricky) if PTERM is infix separator or not-required terminator. Parse Error otherwise.
      > foo/// <x>foo/</x> if PTERM is infix separator or not-required terminator.
      >
      >
      > (EEC = PTERM[1] != EC) EC="/" EEC="$" PTERM="$;"
      >
      > foo$;bar <x>foo</x><y>bar</y>
      > foo/$;bar <x>foo</x><y>bar</x>
      > foo$/$;bar <x>foo/</x><y>bar</y>
      > foo$$;bar <x>foo$</x><y>bar</y>
      > foo//$;bar <x>foo</x><y>bar</y> (Tricky)
      > foo//////////bar <x>foobar</x> (all lonely ECs)
      > foo$$$$$bar <x>foo$$$$$bar</x> (all lonely EECs)
      > foo$//;bar <x>foo/;bar</x>
      > foo$/$$;bar <x>foo/$</x><y>bar</y>
      > foo$; <x>foo</x> parse error if PTERM is infix sep
      > foo/$; <x>foo$;</x> parse error if PTERM is required terminator.
      > foo$/$; <x>foo/</x> if PTERM is terminator or postfix sep. PE otherwise.
      > foo$$/$; <x>foo$/</x> if PTERM is terminator or postfix sep. PE otherwise.
      > foo$$$//$; <x>foo$$/$;</x> parse error if PTERM is required terminator
      >
      >
      >
      > (EC = PTERM[1]) != EEC EC=/ EEC=$ TERM=/;
      >
      > foo/;bar <x>foo</x><y>bar</y>
      > foo$/;bar <x>foo/;bar</y>
      > foo$$/;bar <x>foo$</x><y>bar</y>
      > foo//; bar <x>foo/;bar</x>
      > foo///;bar <x>foo/</x><y>bar</y>
      > foo$//;bar <x>foo/</x><y>bar</y>
      > foo$///;bar <x>foo//;bar</x> (Tricky!)
      > foo$////;bar <x>foo//;bar</x> (Tricky!)
      > foo$///////;bar <x>foo//;bar</x> (Tricky!)
      > foo/; <x>foo</x> if PTERM is terminator or postfix sep. PE otherwise.
      > foo$/; <x>foo/;</x> if PTERM is terminator or postfix sep. PE otherwise.
      > foo$$/; <x>foo$/;</x> if PTERM is not required. PE otherwise
      > foo$//; <x>foo/</x> if PTERM is terminator or postfix sep. PE otherwise
      > foo$/$/$/; <x>foo///;</x>if PTERM is not required. PE otherwise
      >
      > EC=EEC=PTERM[1] EC=/ PTERM=/;
      >
      > foo/;bar <x>foo<x><y>bar</y>
      > foo//;bar <x>foo/;bar</y>
      > foo///;bar <x>foo/</x><y>bar</y>
      > foo////bar <x>foo//bar</x>
      > foo////;bar <x>foo//;bar<x> (Tricky)
      > foo/////;bar <x>foo//<x><y>bar</y> (Tricky)
      > foo <x>foo</x> if PTERM is not required. PE otherwise
      > foo/; <x>foo</x> if PTERM is terminator or postfix sep. PE otherwise.
      > foo//; <x>foo/;</x> if PTERM is not required. PE otherwise
      > foo/// <x>foo/</x> if PTERM is not required. PE otherwise
      > foo///; <x>foo</x> if PTERM is terminator or postfix sep. PE otherwise.
      > foo////; <x>foo//;</x> if PTERM is not required. PE otherwise

              twise Taylor Wise
              twise Taylor Wise
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: