# YAML Test Matrix

--- &test-KMK3
  Title: Block Submapping
  Tags: [ mapping ]

YAML

foo:
  bar: 1
baz: 2

Expected Events

+STR
+DOC
+MAP
=VAL :foo
+MAP
=VAL :bar
=VAL :1
-MAP
=VAL :baz
=VAL :2
-MAP
-DOC
-STR

Expected JSON

{
"baz": 2,
"foo": {
"bar": 1
}
}

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-syck-json

 json_ok

perl-xs-json

 json_ok

perl-yaml-json

 json_ok

py-pyyaml-json

 json_ok

py-ruamel-json

 json_ok

ruby-psych-json

 json_ok

dotnet-yamldotnet-json

 json_diff
{
  "baz": "2",
  "foo": {
    "bar": "1"
  }
}

perl-tiny-json

 json_diff
{
  "baz": "2",
  "foo": {
    "bar": "1"
  }
}

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|foo
   1    3    3    3 -VAL |
   1    3    3    3 -NODE|
   1    3    3    3 =SYNX|:
   1    4    4    4 +NODE|
   1    4    4    4 =EOL |\x0a
   2    0    5    5 +MAP |
   2    0    5    5 =DENT|..
   2    2    7    7 +PAIR|
   2    2    7    7 +NODE|
   2    2    7    7 +VAL |
   2    2    7    7 =TEXT|bar
   2    5   10   10 -VAL |
   2    5   10   10 -NODE|
   2    5   10   10 =SYNX|:
   2    6   11   11 =WSPC|.
   2    7   12   12 +NODE|
   2    7   12   12 +VAL |
   2    7   12   12 =TEXT|1
   2    8   13   13 -VAL |
   2    8   13   13 -NODE|
   2    8   13   13 =EOL |\x0a
   3    0   14   14 -PAIR|
   3    0   14   14 -MAP |
   3    0   14   14 -NODE|
   3    0   14   14 -PAIR|
   3    0   14   14 +PAIR|
   3    0   14   14 +NODE|
   3    0   14   14 +VAL |
   3    0   14   14 =TEXT|baz
   3    3   17   17 -VAL |
   3    3   17   17 -NODE|
   3    3   17   17 =SYNX|:
   3    4   18   18 =WSPC|.
   3    5   19   19 +NODE|
   3    5   19   19 +VAL |
   3    5   19   19 =TEXT|2
   3    6   20   20 -VAL |
   3    6   20   20 -NODE|
   3    6   20   20 =EOL |\x0a
   4    0   21   21 -PAIR|
   4    0   21   21 -MAP |
   4    0   21   21 -NODE|
   4    0   21   21 -DOC |

perl-pp-perl

 na
{
  'baz' => 2,
  'foo' => {
             'bar' => 1
           }
}

perl-pplibyaml-perl

 na
{
  'baz' => 2,
  'foo' => {
             'bar' => 1
           }
}

perl-syck-perl

 na
{
  'baz' => 2,
  'foo' => {
             'bar' => 1
           }
}

perl-tiny-perl

 na
{
  'baz' => '2',
  'foo' => {
             'bar' => '1'
           }
}

perl-xs-perl

 na
{
  'baz' => 2,
  'foo' => {
             'bar' => 1
           }
}

perl-yaml-perl

 na
{
  'baz' => 2,
  'foo' => {
             'bar' => 1
           }
}

py-pyyaml-py

 na
{'baz': 2, 'foo': {'bar': 1}}

py-ruamel-py

 na
{'baz': 2, 'foo': {'bar': 1}}