# YAML Test Matrix

--- &test-JEF9:01
  Title: Trailing whitespace in streams
  Tags: [ literal ]

YAML

- |+
   

Expected Events

+STR
+DOC
+SEQ
=VAL |\n
-SEQ
-DOC
-STR

Expected JSON

[
"\n"
]

c-libfyaml-event

 ok

c-libyaml-event

 ok

cpp-rapidyaml-event

 ok

cpp-yamlcpp-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

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

 json_diff
[
  ""
]

perl-yaml-json

 json_diff
[
  "  \n"
]

dotnet-yamldotnet-event

 error
+STR
+DOC
+SEQ
Unhandled exception. YamlDotNet.Core.SemanticErrorException: (Line: 3, Col: 1, Idx: 9) - (Line: 3, Col: 1, Idx: 9): While scanning a literal block scalar, found extra spaces in first line.
   at YamlDotNet.Core.Scanner.ScanBlockScalarBreaks(Int32 currentIndent, StringBuilder breaks, Boolean isLiteral, Mark& end, Nullable`1& isFirstLine)
   at YamlDotNet.Core.Scanner.ScanBlockScalar(Boolean isLiteral)
   at YamlDotNet.Core.Scanner.FetchBlockScalar(Boolean isLiteral)
   at YamlDotNet.Core.Scanner.FetchNextToken()
   at YamlDotNet.Core.Scanner.FetchMoreTokens()
   at YamlDotNet.Core.Scanner.MoveNextWithoutConsuming()
   at YamlDotNet.Core.Parser.GetCurrentToken()
   at YamlDotNet.Core.Parser.ParseBlockSequenceEntry(Boolean isFirst)
   at YamlDotNet.Core.Parser.StateMachine()
   at YamlDotNet.Core.Parser.MoveNext()
   at YamlDotNet.RepresentationModel.LibYamlEventStream.WriteTo(TextWriter textWriter)
   at Program.Main(String[] commandLineArguments)
Aborted (core dumped)

dotnet-yamldotnet-json

 error
Unhandled exception. YamlDotNet.Core.SemanticErrorException: (Line: 3, Col: 1, Idx: 9) - (Line: 3, Col: 1, Idx: 9): While scanning a literal block scalar, found extra spaces in first line.
   at YamlDotNet.Core.Scanner.ScanBlockScalarBreaks(Int32 currentIndent, StringBuilder breaks, Boolean isLiteral, Mark& end, Nullable`1& isFirstLine)
   at YamlDotNet.Core.Scanner.ScanBlockScalar(Boolean isLiteral)
   at YamlDotNet.Core.Scanner.FetchBlockScalar(Boolean isLiteral)
   at YamlDotNet.Core.Scanner.FetchNextToken()
   at YamlDotNet.Core.Scanner.FetchMoreTokens()
   at YamlDotNet.Core.Scanner.MoveNextWithoutConsuming()
   at YamlDotNet.Core.Parser.GetCurrentToken()
   at YamlDotNet.Core.Parser.ParseBlockSequenceEntry(Boolean isFirst)
   at YamlDotNet.Core.Parser.StateMachine()
   at YamlDotNet.Core.Parser.MoveNext()
   at YamlDotNet.Serialization.NodeDeserializers.CollectionNodeDeserializer.DeserializeHelper(Type tItem, IParser parser, Func`3 nestedObjectDeserializer, IList result, Boolean canUpdate)
   at YamlDotNet.Serialization.NodeDeserializers.CollectionNodeDeserializer.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)

hs-hsyaml-event

 error
+STR
+DOC
+SEQ
Parsing error near byte offset Pos {posByteOffset = 9, posCharOffset = 9, posLine = 3, posColumn = 0} (leading empty lines contain more spaces than the first non-empty line in scalar: "  \n")

hs-hsyaml-json

 error
hsyaml-parser: user error (leading empty lines contain more spaces than the first non-empty line in scalar: "  \n")

perl-tiny-json

 error
YAML::Tiny failed to find multi-line scalar content at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

 error
YAML::Tiny failed to find multi-line scalar content at /yaml/bin/perl-tiny-perl line 15.

hs-reference-yeast

 na
Line  Col Char Byte Token|Content
   1    0    0    0 +DOC |
   1    0    0    0 +NODE|
   1    0    0    0 +SEQ |
   1    0    0    0 =SYNX|-
   1    1    1    1 +NODE|
   1    1    1    1 =WSPC|.
   1    2    2    2 +VAL |
   1    2    2    2 =SYNX||
   1    3    3    3 =SYNX|+
   1    4    4    4 =EOL |\x0a
   2    0    5    5 =DENT|...
   2    3    8    8 =NEWL|\x0a
   3    0    9    9 -VAL |
   3    0    9    9 -NODE|
   3    0    9    9 -SEQ |
   3    0    9    9 -NODE|
   3    0    9    9 -DOC |

perl-pp-perl

 na
[
  '
'
]

perl-pplibyaml-perl

 na
[
  '
'
]

perl-syck-perl

 na
[
  ''
]

perl-xs-perl

 na
[
  '
'
]

perl-yaml-perl

 na
[
  '  
'
]

py-pyyaml-py

 na
['\n']

py-ruamel-py

 na
['\n']