# 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

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

cpp-event

 ok

hs-yaml-event

 ok

java-event

 ok

js-event

 ok

libyaml-event

 ok

nimyaml-event

 ok

perl5-pp-event

 ok

pyyaml-event

 ok

ruamel-event

 ok

hs-yaml-json

 json_ok

java-json

 json_ok

js-json

 json_ok

js-yaml-json

 json_ok

luajit-json

 json_ok

perl5-pp-json

 json_ok

perl5-xs-json

 json_ok

pyyaml-json

 json_ok

ruamel-json

 json_ok

ruby-json

 json_ok

perl5-pegex-event

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

perl5-pm-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"
}

perl5-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"
}

perl5-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"
}

perl5-pm-pl

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

perl5-pp-pl

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

perl5-syck-pl

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

perl5-tiny-pl

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

perl5-xs-pl

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

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': u'Sosa did fine.\u263a'}

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': u'Sosa did fine.\u263a'}