# YAML Test Matrix

--- &test-M5C3
  Title: Spec Example 8.21. Block Scalar Nodes
  Tags: [ 1.3-err, folded, indent, literal, local-tag, spec, tag ]

YAML

literal: |2
  value
folded:
   !foo
  >1
 value

Expected Events

+STR
+DOC
+MAP
=VAL :literal
=VAL |value\n
=VAL :folded
=VAL <!foo> >value\n
-MAP
-DOC
-STR

Expected JSON

{
"folded": "value\n",
"literal": "value\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

py-ruamel-event

 ok

rust-yamlrust-event

 ok

c-libfyaml-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

py-ruamel-json

 json_ok

ruby-psych-json

 json_ok

perl-syck-json

 error
Syck parser (line 5, column 2): syntax error at /perl5/lib/perl5/x86_64-linux-thread-multi/YAML/Syck.pm line 60, <> line 1.

perl-syck-perl

 error
Syck parser (line 5, column 2): syntax error at /perl5/lib/perl5/x86_64-linux-thread-multi/YAML/Syck.pm line 60, <> line 1.

perl-yaml-json

 error
YAML Error: Expected separator '---'
   Code: YAML_PARSE_ERR_NO_SEPARATOR
   Line: 4
   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: 4
   Document: 2
 at /perl5/lib/perl5/YAML/Loader.pm line 88.

hs-reference-yeast

 na
Line  Col Char Byte Token|Content
   1    0    0    0 +DOC |
   1    0    0    0 +NODE|
   1    0    0    0 +MAP |
   1    0    0    0 +PAIR|
   1    0    0    0 +NODE|
   1    0    0    0 +VAL |
   1    0    0    0 =TEXT|literal
   1    7    7    7 -VAL |
   1    7    7    7 -NODE|
   1    7    7    7 =SYNX|:
   1    8    8    8 +NODE|
   1    8    8    8 =WSPC|.
   1    9    9    9 +VAL |
   1    9    9    9 =SYNX||
   1   10   10   10 =SYNX|2
   1   11   11   11 =EOL |\x0a
   2    0   12   12 =DENT|..
   2    2   14   14 =TEXT|value
   2    7   19   19 =NEWL|\x0a
   3    0   20   20 -VAL |
   3    0   20   20 -NODE|
   3    0   20   20 -PAIR|
   3    0   20   20 +PAIR|
   3    0   20   20 +NODE|
   3    0   20   20 +VAL |
   3    0   20   20 =TEXT|folded
   3    6   26   26 -VAL |
   3    6   26   26 -NODE|
   3    6   26   26 =SYNX|:
   3    7   27   27 +NODE|
   3    7   27   27 =EOL |\x0a
   4    0   28   28 =DENT|.
   4    1   29   29 =WSPC|..
   4    3   31   31 +PROP|
   4    3   31   31 +TAG |
   4    3   31   31 +HAND|
   4    3   31   31 =SYNX|!
   4    4   32   32 -HAND|
   4    4   32   32 =META|foo
   4    7   35   35 -TAG |
   4    7   35   35 -PROP|
   4    7   35   35 =EOL |\x0a
   5    0   36   36 =DENT|.
   5    1   37   37 =WSPC|.
   5    2   38   38 +VAL |
   5    2   38   38 =SYNX|>
   5    3   39   39 =SYNX|1
   5    4   40   40 =EOL |\x0a
   6    0   41   41 =DENT|.
   6    1   42   42 =TEXT|value
   6    6   47   47 =NEWL|\x0a
   7    0   48   48 -VAL |
   7    0   48   48 -NODE|
   7    0   48   48 -PAIR|
   7    0   48   48 -MAP |
   7    0   48   48 -NODE|
   7    0   48   48 -DOC |

perl-pp-perl

 na
{
  'folded' => 'value
',
  'literal' => 'value
'
}

perl-pplibyaml-perl

 na
{
  'folded' => 'value
',
  'literal' => 'value
'
}

perl-xs-perl

 na
{
  'folded' => 'value
',
  'literal' => 'value
'
}

py-pyyaml-py

 na
{'folded': GenericScalar(tag='!foo', content='value\n'), 'literal': 'value\n'}

py-ruamel-py

 na
{'folded': GenericScalar(tag='!foo', content='value\n'), 'literal': 'value\n'}

dotnet-yamldotnet-json

 ni
Unhandled exception. YamlDotNet.Core.YamlException: (Line: 4, Col: 4, Idx: 31) - (Line: 7, Col: 1, Idx: 48): Encountered an unresolved tag '!foo'
   at YamlDotNet.Serialization.NodeTypeResolvers.PreventUnknownTagsNodeTypeResolver.YamlDotNet.Serialization.INodeTypeResolver.Resolve(NodeEvent nodeEvent, Type& currentType)
   at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.GetTypeFromEvent(NodeEvent nodeEvent, Type currentType)
   at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   at YamlDotNet.Serialization.ValueDeserializers.AliasValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.<>c__DisplayClass3_0.<DeserializeValue>b__0(IParser r, Type t)
   at YamlDotNet.Serialization.NodeDeserializers.DictionaryNodeDeserializer.DeserializeHelper(Type tKey, Type tValue, IParser parser, Func`3 nestedObjectDeserializer, IDictionary result)
   at YamlDotNet.Serialization.NodeDeserializers.DictionaryNodeDeserializer.YamlDotNet.Serialization.INodeDeserializer.Deserialize(IParser parser, Type expectedType, Func`3 nestedObjectDeserializer, Object& value)
   at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   at YamlDotNet.Serialization.ValueDeserializers.AliasValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   at YamlDotNet.Serialization.Deserializer.Deserialize(IParser parser, Type type)
   at YamlDotNet.Serialization.Deserializer.Deserialize(TextReader input, Type type)
   at YamlDotNet.Serialization.Deserializer.Deserialize(TextReader input)
   at Program.Main(String[] commandLineArguments)
Aborted (core dumped)

perl-tiny-json

 ni
YAML::Tiny failed to classify line '   !foo' at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

 ni
YAML::Tiny failed to classify line '   !foo' at /yaml/bin/perl-tiny-perl line 15.