# YAML Test Matrix

--- &test-G4RS
  Title: Spec Example 2.17. Quoted Scalars
  Tags: [ scalar, spec ]

YAML

unicode: "Sosa did fine.\u263A"
control: "\b1998\t1999\t2000\n"
hex esc: "\x0d\x0a is \r\n"

single: '"Howdy!" he cried.'
quoted: ' # Not a ''comment''.'
tie-fighter: '|\-*-/|'

Expected Events

+STR
+DOC
+MAP
=VAL :unicode
=VAL "Sosa did fine.☺
=VAL :control
=VAL "\b1998\t1999\t2000\n
=VAL :hex esc
=VAL "\r\n is \r\n
=VAL :single
=VAL '"Howdy!" he cried.
=VAL :quoted
=VAL ' # Not a 'comment'.
=VAL :tie-fighter
=VAL '|\\-*-/|
-MAP
-DOC
-STR

Expected JSON

{
"control": "\b1998\t1999\t2000\n",
"hex esc": "\r\n is \r\n",
"quoted": " # Not a 'comment'.",
"single": "\"Howdy!\" he cried.",
"tie-fighter": "|\\-*-/|",
"unicode": "Sosa did fine.☺"
}

c-libfyaml-event

 ok

c-libyaml-event

 ok

cpp-yamlcpp-event

 ok

dotnet-yamldotnet-event

 ok

hs-hsyaml-event

 ok

java-snakeyaml-event

 ok

js-yaml-event

 ok

nim-nimyaml-event

 ok

perl-pp-event

 ok

perl-pplibyaml-event

 ok

perl-refparser-event

 ok

py-pyyaml-event

 ok

py-ruamel-event

 ok

c-libfyaml-json

 json_ok

hs-hsyaml-json

 json_ok

java-snakeyaml-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

dotnet-yamldotnet-json

 json_diff
parse error: Invalid string: control characters from U+0000 through U+001F must be escaped at line 1, column 64

perl-syck-json

 json_diff
{
  "control": "\b1998\t1999\t2000\n",
  "hex esc": "\r\n is \r\n",
  "quoted": " # Not a 'comment'.",
  "single": "\"Howdy!\" he cried.",
  "tie-fighter": "|\\-*-/|",
  "unicode": "Sosa did fine.\\u263A"
}

perl-tiny-json

 json_diff
{
  "control": "\b1998\t1999\t2000\n",
  "hex esc": "\r\n is \r\n",
  "quoted": " # Not a 'comment'.",
  "single": "\"Howdy!\" he cried.",
  "tie-fighter": "|\\-*-/|",
  "unicode": "Sosa did fine.\\u263A"
}

perl-yaml-json

 json_diff
{
  "control": "\\b1998\t1999\t2000\n",
  "hex esc": "\r\n is \r\n",
  "quoted": " # Not a 'comment'.",
  "single": "\"Howdy!\" he cried.",
  "tie-fighter": "|\\-*-/|",
  "unicode": "Sosa did fine.\\u263A"
}

perl-pp-perl

 na
{
  'control' => '1998	1999	2000
',
  'hex esc' => '
 is 
',
  'quoted' => ' # Not a \'comment\'.',
  'single' => '"Howdy!" he cried.',
  'tie-fighter' => '|\\-*-/|',
  'unicode' => "Sosa did fine.\x{263a}"
}

perl-pplibyaml-perl

 na
{
  'control' => '1998	1999	2000
',
  'hex esc' => '
 is 
',
  'quoted' => ' # Not a \'comment\'.',
  'single' => '"Howdy!" he cried.',
  'tie-fighter' => '|\\-*-/|',
  'unicode' => "Sosa did fine.\x{263a}"
}

perl-syck-perl

 na
{
  'control' => '1998	1999	2000
',
  'hex esc' => '
 is 
',
  'quoted' => ' # Not a \'comment\'.',
  'single' => '"Howdy!" he cried.',
  'tie-fighter' => '|\\-*-/|',
  'unicode' => 'Sosa did fine.\\u263A'
}

perl-tiny-perl

 na
{
  'control' => '1998	1999	2000
',
  'hex esc' => '
 is 
',
  'quoted' => ' # Not a \'comment\'.',
  'single' => '"Howdy!" he cried.',
  'tie-fighter' => '|\\-*-/|',
  'unicode' => 'Sosa did fine.\\u263A'
}

perl-xs-perl

 na
{
  'control' => '1998	1999	2000
',
  'hex esc' => '
 is 
',
  'quoted' => ' # Not a \'comment\'.',
  'single' => '"Howdy!" he cried.',
  'tie-fighter' => '|\\-*-/|',
  'unicode' => "Sosa did fine.\x{263a}"
}

perl-yaml-perl

 na
{
  'control' => '\\b1998	1999	2000
',
  'hex esc' => '
 is 
',
  'quoted' => ' # Not a \'comment\'.',
  'single' => '"Howdy!" he cried.',
  'tie-fighter' => '|\\-*-/|',
  'unicode' => 'Sosa did fine.\\u263A'
}

py-pyyaml-py

 na
{'control': '\x081998\t1999\t2000\n',
 'hex esc': '\r\n is \r\n',
 'quoted': " # Not a 'comment'.",
 'single': '"Howdy!" he cried.',
 'tie-fighter': '|\\-*-/|',
 'unicode': 'Sosa did fine.☺'}

py-ruamel-py

 na
{'control': '\x081998\t1999\t2000\n',
 'hex esc': '\r\n is \r\n',
 'quoted': " # Not a 'comment'.",
 'single': '"Howdy!" he cried.',
 'tie-fighter': '|\\-*-/|',
 'unicode': 'Sosa did fine.☺'}