# YAML Test Matrix

--- &test-652Z
  Title: Question mark at start of flow key
  Tags: [ flow ]

YAML

{ ?foo: bar,
bar: 42
}

Expected Events

+STR
+DOC
+MAP {}
=VAL :?foo
=VAL :bar
=VAL :bar
=VAL :42
-MAP
-DOC
-STR

Expected JSON

{
"?foo": "bar",
"bar": 42
}

c-libfyaml-event

 ok

cpp-rapidyaml-event

 ok

js-yaml-event

 ok

nim-nimyaml-event

 ok

perl-pp-event

 ok

perl-refparser-event

 ok

rust-yamlrust-event

 ok

c-libfyaml-json

 json_ok

js-jsyaml-json

 json_ok

js-yaml-json

 json_ok

perl-pp-json

 json_ok

perl-syck-json

 json_ok

c-libyaml-event

 diff
Got Events:
+STR
+DOC
+MAP {}
=VAL :foo
=VAL :bar
=VAL :bar
=VAL :42
-MAP
-DOC
-STR

dotnet-yamldotnet-event

 diff
Minimal Events:
+STR
+DOC
+MAP
=VAL :?foo
=VAL :bar
=VAL :bar
=VAL :42
-MAP
-DOC
-STR
Got Events:
+STR
+DOC
+MAP
=VAL :foo
=VAL :bar
=VAL :bar
=VAL :42
-MAP
-DOC
-STR

py-pyyaml-event

 diff
Got Events:
+STR
+DOC
+MAP {}
=VAL :foo
=VAL :bar
=VAL :bar
=VAL :42
-MAP
-DOC
-STR

py-ruamel-event

 diff
Got Events:
+STR
+DOC
+MAP {}
=VAL :foo
=VAL :bar
=VAL :bar
=VAL :42
-MAP
-DOC
-STR

dotnet-yamldotnet-json

 json_diff
{
  "bar": "42",
  "foo": "bar"
}

go-yaml-json

 json_diff
{
  "bar": 42,
  "foo": "bar"
}

lua-lyaml-json

 json_diff
{
  "bar": 42,
  "foo": "bar"
}

perl-pplibyaml-json

 json_diff
{
  "bar": 42,
  "foo": "bar"
}

perl-xs-json

 json_diff
{
  "bar": 42,
  "foo": "bar"
}

py-pyyaml-json

 json_diff
{
  "bar": 42,
  "foo": "bar"
}

py-ruamel-json

 json_diff
{
  "bar": 42,
  "foo": "bar"
}

ruby-psych-json

 json_diff
{
  "bar": 42,
  "foo": "bar"
}

cpp-yamlcpp-event

 error
+STR
Exception:
yaml-cpp: error at line 1, column 3: unknown token

hs-hsyaml-event

 error
+STR
+DOC
+MAP {}
-MAP
Parsing error near byte offset Pos {posByteOffset = 2, posCharOffset = 2, posLine = 1, posColumn = 2} (Unexpected '?')

hs-hsyaml-json

 error
hsyaml-parser: user error (Unexpected '?')

perl-yaml-json

 error
YAML Error: Can't parse inline map
   Code: YAML_PARSE_ERR_INLINE_MAP
   Line: 1
   Document: 1
 at /perl5/lib/perl5/YAML/Loader.pm line 522.

perl-yaml-perl

 error
YAML Error: Can't parse inline map
   Code: YAML_PARSE_ERR_INLINE_MAP
   Line: 1
   Document: 1
 at /perl5/lib/perl5/YAML/Loader.pm line 522.

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 =SYNX|{
   1    1    1    1 =WSPC|.
   1    2    2    2 -MAP |
   1    2    2    2 -NODE|
   1    2    2    2 =ERR |Unexpected.'?'
   1    2    2    2 =REST|?foo:.bar,
   1   12   12   12 =REST|\x0a
   2    0   13   13 =REST|bar:.42
   2    7   20   20 =REST|\x0a
   3    0   21   21 =REST|}
   3    1   22   22 =REST|\x0a
   4    0   23   23 -DOC |

perl-pp-perl

 na
{
  '?foo' => 'bar',
  'bar' => 42
}

perl-pplibyaml-perl

 na
{
  'bar' => 42,
  'foo' => 'bar'
}

perl-syck-perl

 na
{
  '?foo' => 'bar',
  'bar' => 42
}

perl-xs-perl

 na
{
  'bar' => 42,
  'foo' => 'bar'
}

py-pyyaml-py

 na
{'bar': 42, 'foo': 'bar'}

py-ruamel-py

 na
{'bar': 42, 'foo': 'bar'}

perl-tiny-json

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

perl-tiny-perl

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