Skip to content
Snippets Groups Projects
Select Git revision
  • master-libyaml-test-suite
  • branch/default default protected
  • release/0.2.5
  • master
  • run-test-suite-2
  • master-2
  • release/test
  • testing
  • run-test-suite
  • perlpunk/fix-tag-chars
  • dist
  • packaging
  • release/0.2.4
  • run-test-suite-code
  • release/0.2.3
  • perlpunk/anchor-chars
  • release-0.1.8
  • run-test-suite-list
  • canonical-code-style
  • issue/10
20 results

libyaml

  • Clone with SSH
  • Clone with HTTPS
  • user avatar
    Tina Müller authored
    open_ended can have three states now:
    0: The previous document was ended explicitly with '...'
    1: The previous document wasn't ended with '...'
    2: The last scalar event was a block scalar with trailing empty lines |+, and
       last document wasn't ended with '...'.
       Important at stream end.
    
    This was broken in the past, and fixed in fa1293a.
    With my last PR #162 I added the faulty behaviour again.
    
    The problematic behaviour showed only when all of the following conditions were
    true:
    * writing YAML directives
    * writing unquoted top level scalars
    * writing more than one document
    
    ================== BROKEN ==============================
    
    The first example shows that the document end marker is not emitted before
    the next document. This would be valid in YAML 1.1 if the scalar was quoted,
    but not if it is plain.
    
    This commit fixes this.
    
    echo '--- foo
    --- bar
    ' | ./tests/run-parser-test-suite  | ./tests/run-emitter-test-suite  --directive 1.1
    
    %YAML 1.1
    --- foo
    %YAML 1.1
    --- bar
    
    ================== FIXED ==============================
    
    echo '--- foo
    --- bar
    ' | ./tests/run-parser-test-suite  | ./tests/run-emitter-test-suite  --directive 1.1
    %YAML 1.1
    --- foo
    ...
    %YAML 1.1
    --- bar
    
    =======================================================
    
    Other examples which should look like this (and were correct already before
    this fix):
    
    Open ended scalars like |+ need '...' at the end of the stream:
    
    echo '--- |+
      a
    
    --- |+
      a
    
    ' | ./tests/run-parser-test-suite  | ./tests/run-emitter-test-suite
    --- |+
      a
    
    --- |+
      a
    
    ...
    
    =======================================================
    
    If a document is ended with an explicit '...', the code should not
    print '...' twice:
    
    echo '--- foo
    ...
    --- bar
    ' | ./tests/run-parser-test-suite  | ./tests/run-emitter-test-suite --directive 1.1
    %YAML 1.1
    --- foo
    ...
    %YAML 1.1
    --- bar
    
    ==========================================================
    64758cef
    History
    Name Last commit Last update