# YAML Test Matrix

--- &test-U9NS
  Title: Spec Example 2.8. Play by Play Feed from a Game
  Tags: [ header, spec ]

YAML

---
time: 20:03:20
player: Sammy Sosa
action: strike (miss)
...
---
time: 20:03:47
player: Sammy Sosa
action: grand slam
...

Expected Events

+STR
+DOC ---
+MAP
=VAL :time
=VAL :20:03:20
=VAL :player
=VAL :Sammy Sosa
=VAL :action
=VAL :strike (miss)
-MAP
-DOC ...
+DOC ---
+MAP
=VAL :time
=VAL :20:03:47
=VAL :player
=VAL :Sammy Sosa
=VAL :action
=VAL :grand slam
-MAP
-DOC ...
-STR

Expected JSON

{
"action": "strike (miss)",
"player": "Sammy Sosa",
"time": "20:03:20"
}
{
"action": "grand slam",
"player": "Sammy Sosa",
"time": "20:03:47"
}

c-libfyaml-event

 ok

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

perl-pp-json

 json_ok

perl-pplibyaml-json

 json_ok

perl-tiny-json

 json_ok

perl-xs-json

 json_ok

py-ruamel-json

 json_ok

cpp-rapidyaml-event

 diff
Minimal Events:
+STR
+DOC ---
+MAP
=VAL :time
=VAL :20:03:20
=VAL :player
=VAL :Sammy Sosa
=VAL :action
=VAL :strike (miss)
-MAP
-DOC ...
+DOC ---
+MAP
=VAL :time
=VAL :20:03:47
=VAL :player
=VAL :Sammy Sosa
=VAL :action
=VAL :grand slam
-MAP
-DOC ...
-STR
Transformed Events:
+STR
+DOC ---
+MAP
=VAL :time
=VAL :20:03:20
=VAL :player
=VAL :Sammy Sosa
=VAL :action
=VAL :strike (miss)
-MAP
-DOC
+DOC ---
+MAP
=VAL :time
=VAL :20:03:47
=VAL :player
=VAL :Sammy Sosa
=VAL :action
=VAL :grand slam
-MAP
-DOC
-STR
Got Events:
+STR
+DOC ---
+MAP
=VAL :time
=VAL :20:03:20
=VAL :player
=VAL :Sammy Sosa
=VAL :action
=VAL :strike (miss)
-MAP
-DOC
+DOC ---
+MAP
=VAL :time
=VAL :20:03:47
=VAL :player
=VAL :Sammy Sosa
=VAL :action
=VAL :grand slam
-MAP
-DOC
-STR

lua-lyaml-json

 json_diff
{
  "action": "strike (miss)",
  "player": "Sammy Sosa",
  "time": 72200
}
{
  "action": "grand slam",
  "player": "Sammy Sosa",
  "time": 72227
}

perl-syck-json

 json_diff
{
  "action": "strike (miss)",
  "player": "Sammy Sosa",
  "time": 72200
}
{
  "action": "grand slam",
  "player": "Sammy Sosa",
  "time": 72227
}

py-pyyaml-json

 json_diff
{
  "action": "strike (miss)",
  "player": "Sammy Sosa",
  "time": 72200
}
{
  "action": "grand slam",
  "player": "Sammy Sosa",
  "time": 72227
}

ruby-psych-json

 json_diff
{
  "action": "strike (miss)",
  "player": "Sammy Sosa",
  "time": 72200
}
{
  "action": "grand slam",
  "player": "Sammy Sosa",
  "time": 72227
}

dotnet-yamldotnet-json

 error
Unhandled exception. YamlDotNet.Core.YamlException: (Line: 6, Col: 1, Idx: 64) - (Line: 6, Col: 4, Idx: 67): Expected 'StreamEnd', got 'DocumentStart' (at Line: 6, Col: 1, Idx: 64).
   at YamlDotNet.Core.ParserExtensions.Require[T](IParser parser)
   at YamlDotNet.Core.ParserExtensions.Consume[T](IParser parser)
   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-yaml-json

 error
YAML Error: Invalid element in map
   Code: YAML_LOAD_ERR_BAD_MAP_ELEMENT
   Line: 5
   Document: 1
 at /perl5/lib/perl5/YAML/Loader.pm line 360.

perl-yaml-perl

 error
YAML Error: Invalid element in map
   Code: YAML_LOAD_ERR_BAD_MAP_ELEMENT
   Line: 5
   Document: 1
 at /perl5/lib/perl5/YAML/Loader.pm line 360.

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 =EOL |\x0a
   2    0    4    4 +MAP |
   2    0    4    4 +PAIR|
   2    0    4    4 +NODE|
   2    0    4    4 +VAL |
   2    0    4    4 =TEXT|time
   2    4    8    8 -VAL |
   2    4    8    8 -NODE|
   2    4    8    8 =SYNX|:
   2    5    9    9 =WSPC|.
   2    6   10   10 +NODE|
   2    6   10   10 +VAL |
   2    6   10   10 =TEXT|20:03:20
   2   14   18   18 -VAL |
   2   14   18   18 -NODE|
   2   14   18   18 =EOL |\x0a
   3    0   19   19 -PAIR|
   3    0   19   19 +PAIR|
   3    0   19   19 +NODE|
   3    0   19   19 +VAL |
   3    0   19   19 =TEXT|player
   3    6   25   25 -VAL |
   3    6   25   25 -NODE|
   3    6   25   25 =SYNX|:
   3    7   26   26 =WSPC|.
   3    8   27   27 +NODE|
   3    8   27   27 +VAL |
   3    8   27   27 =TEXT|Sammy.Sosa
   3   18   37   37 -VAL |
   3   18   37   37 -NODE|
   3   18   37   37 =EOL |\x0a
   4    0   38   38 -PAIR|
   4    0   38   38 +PAIR|
   4    0   38   38 +NODE|
   4    0   38   38 +VAL |
   4    0   38   38 =TEXT|action
   4    6   44   44 -VAL |
   4    6   44   44 -NODE|
   4    6   44   44 =SYNX|:
   4    7   45   45 =WSPC|.
   4    8   46   46 +NODE|
   4    8   46   46 +VAL |
   4    8   46   46 =TEXT|strike.(miss)
   4   21   59   59 -VAL |
   4   21   59   59 -NODE|
   4   21   59   59 =EOL |\x0a
   5    0   60   60 -PAIR|
   5    0   60   60 -MAP |
   5    0   60   60 -NODE|
   5    0   60   60 -DOC |
   5    0   60   60 =FOOT|...
   5    3   63   63 =EOL |\x0a
   6    0   64   64 +DOC |
   6    0   64   64 =HEAD|---
   6    3   67   67 +NODE|
   6    3   67   67 =EOL |\x0a
   7    0   68   68 +MAP |
   7    0   68   68 +PAIR|
   7    0   68   68 +NODE|
   7    0   68   68 +VAL |
   7    0   68   68 =TEXT|time
   7    4   72   72 -VAL |
   7    4   72   72 -NODE|
   7    4   72   72 =SYNX|:
   7    5   73   73 =WSPC|.
   7    6   74   74 +NODE|
   7    6   74   74 +VAL |
   7    6   74   74 =TEXT|20:03:47
   7   14   82   82 -VAL |
   7   14   82   82 -NODE|
   7   14   82   82 =EOL |\x0a
   8    0   83   83 -PAIR|
   8    0   83   83 +PAIR|
   8    0   83   83 +NODE|
   8    0   83   83 +VAL |
   8    0   83   83 =TEXT|player
   8    6   89   89 -VAL |
   8    6   89   89 -NODE|
   8    6   89   89 =SYNX|:
   8    7   90   90 =WSPC|.
   8    8   91   91 +NODE|
   8    8   91   91 +VAL |
   8    8   91   91 =TEXT|Sammy.Sosa
   8   18  101  101 -VAL |
   8   18  101  101 -NODE|
   8   18  101  101 =EOL |\x0a
   9    0  102  102 -PAIR|
   9    0  102  102 +PAIR|
   9    0  102  102 +NODE|
   9    0  102  102 +VAL |
   9    0  102  102 =TEXT|action
   9    6  108  108 -VAL |
   9    6  108  108 -NODE|
   9    6  108  108 =SYNX|:
   9    7  109  109 =WSPC|.
   9    8  110  110 +NODE|
   9    8  110  110 +VAL |
   9    8  110  110 =TEXT|grand.slam
   9   18  120  120 -VAL |
   9   18  120  120 -NODE|
   9   18  120  120 =EOL |\x0a
  10    0  121  121 -PAIR|
  10    0  121  121 -MAP |
  10    0  121  121 -NODE|
  10    0  121  121 -DOC |
  10    0  121  121 =FOOT|...
  10    3  124  124 =EOL |\x0a

perl-pp-perl

 na
{
  'action' => 'strike (miss)',
  'player' => 'Sammy Sosa',
  'time' => '20:03:20'
}
{
  'action' => 'grand slam',
  'player' => 'Sammy Sosa',
  'time' => '20:03:47'
}

perl-pplibyaml-perl

 na
{
  'action' => 'strike (miss)',
  'player' => 'Sammy Sosa',
  'time' => '20:03:20'
}
{
  'action' => 'grand slam',
  'player' => 'Sammy Sosa',
  'time' => '20:03:47'
}

perl-syck-perl

 na
{
  'action' => 'strike (miss)',
  'player' => 'Sammy Sosa',
  'time' => 72200
}
{
  'action' => 'grand slam',
  'player' => 'Sammy Sosa',
  'time' => 72227
}

perl-tiny-perl

 na
{
  'action' => 'strike (miss)',
  'player' => 'Sammy Sosa',
  'time' => '20:03:20'
}
{
  'action' => 'grand slam',
  'player' => 'Sammy Sosa',
  'time' => '20:03:47'
}

perl-xs-perl

 na
{
  'action' => 'strike (miss)',
  'player' => 'Sammy Sosa',
  'time' => '20:03:20'
}
{
  'action' => 'grand slam',
  'player' => 'Sammy Sosa',
  'time' => '20:03:47'
}

py-pyyaml-py

 na
{'action': 'strike (miss)', 'player': 'Sammy Sosa', 'time': 72200}
{'action': 'grand slam', 'player': 'Sammy Sosa', 'time': 72227}

py-ruamel-py

 na
{'action': 'strike (miss)', 'player': 'Sammy Sosa', 'time': '20:03:20'}
{'action': 'grand slam', 'player': 'Sammy Sosa', 'time': '20:03:47'}