# YAML Test Matrix

--- &test-DWX9
  Title: Spec Example 8.8. Literal Content
  Tags: [ 1.3-err, comment, literal, scalar, spec, whitespace ]

YAML

|
 
  
  literal
   
  
  text

 # Comment

Expected Events

+STR
+DOC
=VAL |\n\nliteral\n \n\ntext\n
-DOC
-STR

Expected JSON

"\n\nliteral\n \n\ntext\n"

c-libfyaml-event

 ok

c-libyaml-event

 ok

cpp-rapidyaml-event

 ok

cpp-yamlcpp-event

 ok

dotnet-yamldotnet-event

 ok

hs-hsyaml-event

 ok

js-yaml-event

 ok

nim-nimyaml-event

 ok

perl-pp-event

 ok

perl-refparser-event

 ok

py-pyyaml-event

 ok

rust-yamlrust-event

 ok

c-libfyaml-json

 json_ok

dotnet-yamldotnet-json

 json_ok

go-yaml-json

 json_ok

hs-hsyaml-json

 json_ok

js-jsyaml-json

 json_ok

js-yaml-json

 json_ok

lua-lyaml-json

 json_ok

perl-pp-json

 json_ok

perl-pplibyaml-json

 json_ok

perl-xs-json

 json_ok

py-pyyaml-json

 json_ok

ruby-psych-json

 json_ok

perl-syck-json

 json_diff
"\n\nliteral\n\n\ntext\n"

perl-tiny-json

 error
YAML::Tiny failed to classify line '|' at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

 error
YAML::Tiny failed to classify line '|' at /yaml/bin/perl-tiny-perl line 15.

perl-yaml-json

 error
YAML Error: Expected separator '---'
   Code: YAML_PARSE_ERR_NO_SEPARATOR
   Line: 1
   Document: 2
 at /perl5/lib/perl5/YAML/Loader.pm line 88.

perl-yaml-perl

 error
YAML Error: Expected separator '---'
   Code: YAML_PARSE_ERR_NO_SEPARATOR
   Line: 1
   Document: 2
 at /perl5/lib/perl5/YAML/Loader.pm line 88.

py-ruamel-event

 error
+STR
Traceback (most recent call last):
  File "/yaml/bin/py-ruamel-event", line 9, in <module>
    for event in yaml.parse(sys.stdin.read()):
  File "/python/lib/python3.12/site-packages/ruamel/yaml/main.py", line 371, in parse
    while parser.check_event():
          ^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 141, in check_event
    self.current_event = self.state()
                         ^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 187, in parse_implicit_document_start
    if not self.scanner.check_token(DirectiveToken, DocumentStartToken, StreamEndToken):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 170, in check_token
    self.fetch_more_tokens()
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 294, in fetch_more_tokens
    return self.fetch_literal()
           ^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 680, in fetch_literal
    self.fetch_block_scalar(style='|')
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 691, in fetch_block_scalar
    self.tokens.append(self.scan_block_scalar(style))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 1128, in scan_block_scalar
    breaks, max_indent, end_mark = self.scan_block_scalar_indentation()
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 1317, in scan_block_scalar_indentation
    raise ScannerError(
ruamel.yaml.scanner.ScannerError: more indented follow up line than first in a block scalar
  in "<unicode string>", line 4, column 3:
      literal
      ^ (line: 4)

py-ruamel-json

 error
Traceback (most recent call last):
  File "/yaml/bin/py-ruamel-json", line 21, in <module>
    for doc in yaml.load_all(sys.stdin.read()):
  File "/python/lib/python3.12/site-packages/ruamel/yaml/main.py", line 475, in load_all
    while constructor.check_data():
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/constructor.py", line 105, in check_data
    return self.composer.check_node()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/composer.py", line 58, in check_node
    return not self.parser.check_event(StreamEndEvent)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 141, in check_event
    self.current_event = self.state()
                         ^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 187, in parse_implicit_document_start
    if not self.scanner.check_token(DirectiveToken, DocumentStartToken, StreamEndToken):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 170, in check_token
    self.fetch_more_tokens()
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 294, in fetch_more_tokens
    return self.fetch_literal()
           ^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 680, in fetch_literal
    self.fetch_block_scalar(style='|')
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 691, in fetch_block_scalar
    self.tokens.append(self.scan_block_scalar(style))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 1128, in scan_block_scalar
    breaks, max_indent, end_mark = self.scan_block_scalar_indentation()
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 1317, in scan_block_scalar_indentation
    raise ScannerError(
ruamel.yaml.scanner.ScannerError: more indented follow up line than first in a block scalar
  in "<unicode string>", line 4, column 3:
      literal
      ^ (line: 4)

py-ruamel-py

 error
Traceback (most recent call last):
  File "/yaml/bin/py-ruamel-py", line 38, in <module>
    for doc in yaml.load_all(sys.stdin.read()):
  File "/python/lib/python3.12/site-packages/ruamel/yaml/main.py", line 475, in load_all
    while constructor.check_data():
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/constructor.py", line 105, in check_data
    return self.composer.check_node()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/composer.py", line 58, in check_node
    return not self.parser.check_event(StreamEndEvent)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 141, in check_event
    self.current_event = self.state()
                         ^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 187, in parse_implicit_document_start
    if not self.scanner.check_token(DirectiveToken, DocumentStartToken, StreamEndToken):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 170, in check_token
    self.fetch_more_tokens()
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 294, in fetch_more_tokens
    return self.fetch_literal()
           ^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 680, in fetch_literal
    self.fetch_block_scalar(style='|')
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 691, in fetch_block_scalar
    self.tokens.append(self.scan_block_scalar(style))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 1128, in scan_block_scalar
    breaks, max_indent, end_mark = self.scan_block_scalar_indentation()
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 1317, in scan_block_scalar_indentation
    raise ScannerError(
ruamel.yaml.scanner.ScannerError: more indented follow up line than first in a block scalar
  in "<unicode string>", line 4, column 3:
      literal
      ^ (line: 4)

hs-reference-yeast

 na
Line  Col Char Byte Token|Content
   1    0    0    0 +DOC |
   1    0    0    0 +NODE|
   1    0    0    0 +VAL |
   1    0    0    0 =SYNX||
   1    1    1    1 =EOL |\x0a
   2    0    2    2 =DENT|.
   2    1    3    3 =NEWL|\x0a
   3    0    4    4 =DENT|.
   3    1    5    5 =TEXT|.
   3    2    6    6 =NEWL|\x0a
   4    0    7    7 =DENT|.
   4    1    8    8 =TEXT|.literal
   4    9   16   16 =NEWL|\x0a
   5    0   17   17 =DENT|.
   5    1   18   18 =TEXT|..
   5    3   20   20 =NEWL|\x0a
   6    0   21   21 =DENT|.
   6    1   22   22 =TEXT|.
   6    2   23   23 =NEWL|\x0a
   7    0   24   24 =DENT|.
   7    1   25   25 =TEXT|.text
   7    6   30   30 =NEWL|\x0a
   8    0   31   31 =NEWL|\x0a
   9    0   32   32 =DENT|.
   9    1   33   33 =TEXT|#.Comment
   9   10   42   42 =NEWL|\x0a
  10    0   43   43 -VAL |
  10    0   43   43 -NODE|
  10    0   43   43 -DOC |

perl-pp-perl

 na
'

literal
 

text
'

perl-pplibyaml-perl

 na
'

literal
 

text
'

perl-syck-perl

 na
'

literal


text
'

perl-xs-perl

 na
'

literal
 

text
'

py-pyyaml-py

 na
'\n\nliteral\n \n\ntext\n'