# 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-rapidyaml-event

 ok

cpp-yamlcpp-event

 ok

dotnet-yamldotnet-event

 ok

hs-hsyaml-event

 ok

java-snakeengine-event

 ok

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

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

raku-yamlish-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"
}

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|unicode
   1    7    7    7 -VAL |
   1    7    7    7 -NODE|
   1    7    7    7 =SYNX|:
   1    8    8    8 =WSPC|.
   1    9    9    9 +NODE|
   1    9    9    9 +VAL |
   1    9    9    9 =SYNX|"
   1   10   10   10 =TEXT|Sosa.did.fine.
   1   24   24   24 +ESC |
   1   24   24   24 =SYNX|\x5c
   1   25   25   25 =SYNX|u
   1   26   26   26 =META|263A
   1   30   30   30 -ESC |
   1   30   30   30 =SYNX|"
   1   31   31   31 -VAL |
   1   31   31   31 -NODE|
   1   31   31   31 =EOL |\x0a
   2    0   32   32 -PAIR|
   2    0   32   32 +PAIR|
   2    0   32   32 +NODE|
   2    0   32   32 +VAL |
   2    0   32   32 =TEXT|control
   2    7   39   39 -VAL |
   2    7   39   39 -NODE|
   2    7   39   39 =SYNX|:
   2    8   40   40 =WSPC|.
   2    9   41   41 +NODE|
   2    9   41   41 +VAL |
   2    9   41   41 =SYNX|"
   2   10   42   42 +ESC |
   2   10   42   42 =SYNX|\x5c
   2   11   43   43 =META|b
   2   12   44   44 -ESC |
   2   12   44   44 =TEXT|1998
   2   16   48   48 +ESC |
   2   16   48   48 =SYNX|\x5c
   2   17   49   49 =META|t
   2   18   50   50 -ESC |
   2   18   50   50 =TEXT|1999
   2   22   54   54 +ESC |
   2   22   54   54 =SYNX|\x5c
   2   23   55   55 =META|t
   2   24   56   56 -ESC |
   2   24   56   56 =TEXT|2000
   2   28   60   60 +ESC |
   2   28   60   60 =SYNX|\x5c
   2   29   61   61 =META|n
   2   30   62   62 -ESC |
   2   30   62   62 =SYNX|"
   2   31   63   63 -VAL |
   2   31   63   63 -NODE|
   2   31   63   63 =EOL |\x0a
   3    0   64   64 -PAIR|
   3    0   64   64 +PAIR|
   3    0   64   64 +NODE|
   3    0   64   64 +VAL |
   3    0   64   64 =TEXT|hex.esc
   3    7   71   71 -VAL |
   3    7   71   71 -NODE|
   3    7   71   71 =SYNX|:
   3    8   72   72 =WSPC|.
   3    9   73   73 +NODE|
   3    9   73   73 +VAL |
   3    9   73   73 =SYNX|"
   3   10   74   74 +ESC |
   3   10   74   74 =SYNX|\x5c
   3   11   75   75 =SYNX|x
   3   12   76   76 =META|0d
   3   14   78   78 -ESC |
   3   14   78   78 +ESC |
   3   14   78   78 =SYNX|\x5c
   3   15   79   79 =SYNX|x
   3   16   80   80 =META|0a
   3   18   82   82 -ESC |
   3   18   82   82 =TEXT|.is.
   3   22   86   86 +ESC |
   3   22   86   86 =SYNX|\x5c
   3   23   87   87 =META|r
   3   24   88   88 -ESC |
   3   24   88   88 +ESC |
   3   24   88   88 =SYNX|\x5c
   3   25   89   89 =META|n
   3   26   90   90 -ESC |
   3   26   90   90 =SYNX|"
   3   27   91   91 -VAL |
   3   27   91   91 -NODE|
   3   27   91   91 =EOL |\x0a
   4    0   92   92 =EOL |\x0a
   5    0   93   93 -PAIR|
   5    0   93   93 +PAIR|
   5    0   93   93 +NODE|
   5    0   93   93 +VAL |
   5    0   93   93 =TEXT|single
   5    6   99   99 -VAL |
   5    6   99   99 -NODE|
   5    6   99   99 =SYNX|:
   5    7  100  100 =WSPC|.
   5    8  101  101 +NODE|
   5    8  101  101 +VAL |
   5    8  101  101 =SYNX|'
   5    9  102  102 =TEXT|"Howdy!".he.cried.
   5   27  120  120 =SYNX|'
   5   28  121  121 -VAL |
   5   28  121  121 -NODE|
   5   28  121  121 =EOL |\x0a
   6    0  122  122 -PAIR|
   6    0  122  122 +PAIR|
   6    0  122  122 +NODE|
   6    0  122  122 +VAL |
   6    0  122  122 =TEXT|quoted
   6    6  128  128 -VAL |
   6    6  128  128 -NODE|
   6    6  128  128 =SYNX|:
   6    7  129  129 =WSPC|.
   6    8  130  130 +NODE|
   6    8  130  130 +VAL |
   6    8  130  130 =SYNX|'
   6    9  131  131 =TEXT|.#.Not.a.
   6   18  140  140 +ESC |
   6   18  140  140 =SYNX|'
   6   19  141  141 =META|'
   6   20  142  142 -ESC |
   6   20  142  142 =TEXT|comment
   6   27  149  149 +ESC |
   6   27  149  149 =SYNX|'
   6   28  150  150 =META|'
   6   29  151  151 -ESC |
   6   29  151  151 =TEXT|.
   6   30  152  152 =SYNX|'
   6   31  153  153 -VAL |
   6   31  153  153 -NODE|
   6   31  153  153 =EOL |\x0a
   7    0  154  154 -PAIR|
   7    0  154  154 +PAIR|
   7    0  154  154 +NODE|
   7    0  154  154 +VAL |
   7    0  154  154 =TEXT|tie-fighter
   7   11  165  165 -VAL |
   7   11  165  165 -NODE|
   7   11  165  165 =SYNX|:
   7   12  166  166 =WSPC|.
   7   13  167  167 +NODE|
   7   13  167  167 +VAL |
   7   13  167  167 =SYNX|'
   7   14  168  168 =TEXT||\x5c-*-/|
   7   21  175  175 =SYNX|'
   7   22  176  176 -VAL |
   7   22  176  176 -NODE|
   7   22  176  176 =EOL |\x0a
   8    0  177  177 -PAIR|
   8    0  177  177 -MAP |
   8    0  177  177 -NODE|
   8    0  177  177 -DOC |

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.☺'}

raku-yamlish-raku

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