# YAML Test Matrix

--- &test-T26H
  Title: Spec Example 8.8. Literal Content [1.3]
  Tags: [ 1.3-mod, 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

 json_diff
"literal\ntext\n"

perl-yaml-json

 json_diff
" \n  \n  literal\n   \n  \n  text\n\n # Comment\n"

py-ruamel-event

 error
+STR
+DOC ---
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 279, in parse_document_content
    if self.scanner.check_token(
       ^^^^^^^^^^^^^^^^^^^^^^^^^
  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 476, in load_all
    yield constructor.get_data()
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/constructor.py", line 110, in get_data
    return self.construct_document(self.composer.get_node())
                                   ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/composer.py", line 63, in get_node
    return self.compose_document()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/composer.py", line 94, in compose_document
    node = self.compose_node(None, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/composer.py", line 106, in compose_node
    if self.parser.check_event(AliasEvent):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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 279, in parse_document_content
    if self.scanner.check_token(
       ^^^^^^^^^^^^^^^^^^^^^^^^^
  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 476, in load_all
    yield constructor.get_data()
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/constructor.py", line 110, in get_data
    return self.construct_document(self.composer.get_node())
                                   ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/composer.py", line 63, in get_node
    return self.compose_document()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/composer.py", line 94, in compose_document
    node = self.compose_node(None, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/composer.py", line 106, in compose_node
    if self.parser.check_event(AliasEvent):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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 279, in parse_document_content
    if self.scanner.check_token(
       ^^^^^^^^^^^^^^^^^^^^^^^^^
  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 =HEAD|---
   1    3    3    3 +NODE|
   1    3    3    3 =WSPC|.
   1    4    4    4 +VAL |
   1    4    4    4 =SYNX||
   1    5    5    5 =EOL |\x0a
   2    0    6    6 =DENT|.
   2    1    7    7 =NEWL|\x0a
   3    0    8    8 =DENT|.
   3    1    9    9 =TEXT|.
   3    2   10   10 =NEWL|\x0a
   4    0   11   11 =DENT|.
   4    1   12   12 =TEXT|.literal
   4    9   20   20 =NEWL|\x0a
   5    0   21   21 =DENT|.
   5    1   22   22 =TEXT|..
   5    3   24   24 =NEWL|\x0a
   6    0   25   25 =DENT|.
   6    1   26   26 =TEXT|.
   6    2   27   27 =NEWL|\x0a
   7    0   28   28 =DENT|.
   7    1   29   29 =TEXT|.text
   7    6   34   34 =NEWL|\x0a
   8    0   35   35 =NEWL|\x0a
   9    0   36   36 =DENT|.
   9    1   37   37 =TEXT|#.Comment
   9   10   46   46 =NEWL|\x0a
  10    0   47   47 -VAL |
  10    0   47   47 -NODE|
  10    0   47   47 -DOC |

perl-pp-perl

 na
'

literal
 

text
'

perl-pplibyaml-perl

 na
'

literal
 

text
'

perl-syck-perl

 na
'

literal


text
'

perl-tiny-perl

 na
'literal
text
'

perl-xs-perl

 na
'

literal
 

text
'

perl-yaml-perl

 na
' 
  
  literal
   
  
  text

 # Comment
'

py-pyyaml-py

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