# YAML Test Matrix

--- &test-NAT4
  Title: Various empty or newline only quoted strings
  Tags: [ double, scalar, single, whitespace ]

YAML

---
a: '
  '
b: '  
  '
c: "
  "
d: "  
  "
e: '

  '
f: "

  "
g: '


  '
h: "


  "

Expected Events

+STR
+DOC ---
+MAP
=VAL :a
=VAL ' 
=VAL :b
=VAL ' 
=VAL :c
=VAL " 
=VAL :d
=VAL " 
=VAL :e
=VAL '\n
=VAL :f
=VAL "\n
=VAL :g
=VAL '\n\n
=VAL :h
=VAL "\n\n
-MAP
-DOC
-STR

Expected JSON

{
"a": " ",
"b": " ",
"c": " ",
"d": " ",
"e": "\n",
"f": "\n",
"g": "\n\n",
"h": "\n\n"
}

c-libfyaml-event

 ok

c-libyaml-event

 ok

cpp-rapidyaml-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

dotnet-yamldotnet-json

 json_ok

go-yaml-json

 json_ok

hs-hsyaml-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

cpp-yamlcpp-event

 diff
Minimal Events:
+STR
+DOC
+MAP
=VAL :a
=VAL : 
=VAL :b
=VAL : 
=VAL :c
=VAL : 
=VAL :d
=VAL : 
=VAL :e
=VAL :\n
=VAL :f
=VAL :\n
=VAL :g
=VAL :\n\n
=VAL :h
=VAL :\n\n
-MAP
-DOC
-STR
Transformed Events:
+STR
+DOC
+MAP
=VAL :a
=VAL : 
=VAL :b
=VAL : 
=VAL :c
=VAL : 
=VAL :d
=VAL : 
=VAL :e
=VAL :
=VAL :f
=VAL :
=VAL :g
=VAL :
=VAL :h
=VAL :
-MAP
-DOC
-STR
Got Events:
+STR
+DOC
+MAP
=VAL :a
=VAL : 
=VAL :b
=VAL : 
=VAL :c
=VAL : 
=VAL :d
=VAL : 
=VAL :e
=VAL :
=VAL :f
=VAL :
=VAL :g
=VAL :
=VAL :h
=VAL :
-MAP
-DOC
-STR

js-jsyaml-json

 json_diff
{
  "a": " ",
  "b": "   ",
  "c": " ",
  "d": "   ",
  "e": "\n",
  "f": "\n",
  "g": "\n\n",
  "h": "\n\n"
}

perl-syck-json

 json_diff
{
  "a": " ",
  "b": "   ",
  "c": " ",
  "d": "   ",
  "e": "\n",
  "f": "\n",
  "g": "\n\n",
  "h": "\n\n"
}

perl-tiny-json

 error
YAML::Tiny does not support a feature in line ''' at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

 error
YAML::Tiny does not support a feature in line ''' at /yaml/bin/perl-tiny-perl line 15.

perl-yaml-json

 error
YAML Error: Inconsistent indentation level
   Code: YAML_PARSE_ERR_INCONSISTENT_INDENTATION
   Line: 3
   Document: 1
 at /perl5/lib/perl5/YAML/Loader.pm line 804.

perl-yaml-perl

 error
YAML Error: Inconsistent indentation level
   Code: YAML_PARSE_ERR_INCONSISTENT_INDENTATION
   Line: 3
   Document: 1
 at /perl5/lib/perl5/YAML/Loader.pm line 804.

hs-reference-yeast

 na
Line  Col Char Byte Token|Content
   1    0    0    0 +DOC |
   1    0    0    0 =HEAD|---
   1    3    3    3 +NODE|
   1    3    3    3 =EOL |\x0a
   2    0    4    4 +MAP |
   2    0    4    4 +PAIR|
   2    0    4    4 +NODE|
   2    0    4    4 +VAL |
   2    0    4    4 =TEXT|a
   2    1    5    5 -VAL |
   2    1    5    5 -NODE|
   2    1    5    5 =SYNX|:
   2    2    6    6 =WSPC|.
   2    3    7    7 +NODE|
   2    3    7    7 +VAL |
   2    3    7    7 =SYNX|'
   2    4    8    8 =FOLD|\x0a
   3    0    9    9 =DENT|.
   3    1   10   10 =WSPC|.
   3    2   11   11 =SYNX|'
   3    3   12   12 -VAL |
   3    3   12   12 -NODE|
   3    3   12   12 =EOL |\x0a
   4    0   13   13 -PAIR|
   4    0   13   13 +PAIR|
   4    0   13   13 +NODE|
   4    0   13   13 +VAL |
   4    0   13   13 =TEXT|b
   4    1   14   14 -VAL |
   4    1   14   14 -NODE|
   4    1   14   14 =SYNX|:
   4    2   15   15 =WSPC|.
   4    3   16   16 +NODE|
   4    3   16   16 +VAL |
   4    3   16   16 =SYNX|'
   4    4   17   17 =WSPC|..
   4    6   19   19 =FOLD|\x0a
   5    0   20   20 =DENT|.
   5    1   21   21 =WSPC|.
   5    2   22   22 =SYNX|'
   5    3   23   23 -VAL |
   5    3   23   23 -NODE|
   5    3   23   23 =EOL |\x0a
   6    0   24   24 -PAIR|
   6    0   24   24 +PAIR|
   6    0   24   24 +NODE|
   6    0   24   24 +VAL |
   6    0   24   24 =TEXT|c
   6    1   25   25 -VAL |
   6    1   25   25 -NODE|
   6    1   25   25 =SYNX|:
   6    2   26   26 =WSPC|.
   6    3   27   27 +NODE|
   6    3   27   27 +VAL |
   6    3   27   27 =SYNX|"
   6    4   28   28 =FOLD|\x0a
   7    0   29   29 =DENT|.
   7    1   30   30 =WSPC|.
   7    2   31   31 =SYNX|"
   7    3   32   32 -VAL |
   7    3   32   32 -NODE|
   7    3   32   32 =EOL |\x0a
   8    0   33   33 -PAIR|
   8    0   33   33 +PAIR|
   8    0   33   33 +NODE|
   8    0   33   33 +VAL |
   8    0   33   33 =TEXT|d
   8    1   34   34 -VAL |
   8    1   34   34 -NODE|
   8    1   34   34 =SYNX|:
   8    2   35   35 =WSPC|.
   8    3   36   36 +NODE|
   8    3   36   36 +VAL |
   8    3   36   36 =SYNX|"
   8    4   37   37 =WSPC|..
   8    6   39   39 =FOLD|\x0a
   9    0   40   40 =DENT|.
   9    1   41   41 =WSPC|.
   9    2   42   42 =SYNX|"
   9    3   43   43 -VAL |
   9    3   43   43 -NODE|
   9    3   43   43 =EOL |\x0a
  10    0   44   44 -PAIR|
  10    0   44   44 +PAIR|
  10    0   44   44 +NODE|
  10    0   44   44 +VAL |
  10    0   44   44 =TEXT|e
  10    1   45   45 -VAL |
  10    1   45   45 -NODE|
  10    1   45   45 =SYNX|:
  10    2   46   46 =WSPC|.
  10    3   47   47 +NODE|
  10    3   47   47 +VAL |
  10    3   47   47 =SYNX|'
  10    4   48   48 =EOL |\x0a
  11    0   49   49 =NEWL|\x0a
  12    0   50   50 =DENT|.
  12    1   51   51 =WSPC|.
  12    2   52   52 =SYNX|'
  12    3   53   53 -VAL |
  12    3   53   53 -NODE|
  12    3   53   53 =EOL |\x0a
  13    0   54   54 -PAIR|
  13    0   54   54 +PAIR|
  13    0   54   54 +NODE|
  13    0   54   54 +VAL |
  13    0   54   54 =TEXT|f
  13    1   55   55 -VAL |
  13    1   55   55 -NODE|
  13    1   55   55 =SYNX|:
  13    2   56   56 =WSPC|.
  13    3   57   57 +NODE|
  13    3   57   57 +VAL |
  13    3   57   57 =SYNX|"
  13    4   58   58 =EOL |\x0a
  14    0   59   59 =NEWL|\x0a
  15    0   60   60 =DENT|.
  15    1   61   61 =WSPC|.
  15    2   62   62 =SYNX|"
  15    3   63   63 -VAL |
  15    3   63   63 -NODE|
  15    3   63   63 =EOL |\x0a
  16    0   64   64 -PAIR|
  16    0   64   64 +PAIR|
  16    0   64   64 +NODE|
  16    0   64   64 +VAL |
  16    0   64   64 =TEXT|g
  16    1   65   65 -VAL |
  16    1   65   65 -NODE|
  16    1   65   65 =SYNX|:
  16    2   66   66 =WSPC|.
  16    3   67   67 +NODE|
  16    3   67   67 +VAL |
  16    3   67   67 =SYNX|'
  16    4   68   68 =EOL |\x0a
  17    0   69   69 =NEWL|\x0a
  18    0   70   70 =NEWL|\x0a
  19    0   71   71 =DENT|.
  19    1   72   72 =WSPC|.
  19    2   73   73 =SYNX|'
  19    3   74   74 -VAL |
  19    3   74   74 -NODE|
  19    3   74   74 =EOL |\x0a
  20    0   75   75 -PAIR|
  20    0   75   75 +PAIR|
  20    0   75   75 +NODE|
  20    0   75   75 +VAL |
  20    0   75   75 =TEXT|h
  20    1   76   76 -VAL |
  20    1   76   76 -NODE|
  20    1   76   76 =SYNX|:
  20    2   77   77 =WSPC|.
  20    3   78   78 +NODE|
  20    3   78   78 +VAL |
  20    3   78   78 =SYNX|"
  20    4   79   79 =EOL |\x0a
  21    0   80   80 =NEWL|\x0a
  22    0   81   81 =NEWL|\x0a
  23    0   82   82 =DENT|.
  23    1   83   83 =WSPC|.
  23    2   84   84 =SYNX|"
  23    3   85   85 -VAL |
  23    3   85   85 -NODE|
  23    3   85   85 =EOL |\x0a
  24    0   86   86 -PAIR|
  24    0   86   86 -MAP |
  24    0   86   86 -NODE|
  24    0   86   86 -DOC |

perl-pp-perl

 na
{
  'a' => ' ',
  'b' => ' ',
  'c' => ' ',
  'd' => ' ',
  'e' => '
',
  'f' => '
',
  'g' => '

',
  'h' => '

'
}

perl-pplibyaml-perl

 na
{
  'a' => ' ',
  'b' => ' ',
  'c' => ' ',
  'd' => ' ',
  'e' => '
',
  'f' => '
',
  'g' => '

',
  'h' => '

'
}

perl-syck-perl

 na
{
  'a' => ' ',
  'b' => '   ',
  'c' => ' ',
  'd' => '   ',
  'e' => '
',
  'f' => '
',
  'g' => '

',
  'h' => '

'
}

perl-xs-perl

 na
{
  'a' => ' ',
  'b' => ' ',
  'c' => ' ',
  'd' => ' ',
  'e' => '
',
  'f' => '
',
  'g' => '

',
  'h' => '

'
}

py-pyyaml-py

 na
{'a': ' ',
 'b': ' ',
 'c': ' ',
 'd': ' ',
 'e': '\n',
 'f': '\n',
 'g': '\n\n',
 'h': '\n\n'}

py-ruamel-py

 na
{'a': ' ',
 'b': ' ',
 'c': ' ',
 'd': ' ',
 'e': '\n',
 'f': '\n',
 'g': '\n\n',
 'h': '\n\n'}