# 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

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

cpp-event

 ok

hs-yaml-event

 ok

java-event

 ok

js-event

 ok

libyaml-event

 ok

nimyaml-event

 ok

perl5-pegex-event

 ok

perl5-pp-event

 ok

pyyaml-event

 ok

ruamel-event

 ok

hs-yaml-json

 json_ok

js-json

 json_ok

perl5-pp-json

 json_ok

perl5-tiny-json

 json_ok

perl5-xs-json

 json_ok

ruamel-json

 json_ok

java-json

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

js-yaml-json

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

luajit-json

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

perl5-syck-json

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

pyyaml-json

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

ruby-json

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

perl5-pm-json

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

perl5-pm-pl

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

perl5-pp-pl

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

perl5-syck-pl

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

perl5-tiny-pl

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

perl5-xs-pl

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

pyyaml-py

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

ruamel-py

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