Yamlrw Test Results

402
Passed
0
Failed
402
Total

JSON Output Comparison

279
JSON Pass
0
JSON Fail
PASS JSON: PASS 229Q Spec Example 2.4. Sequence of Mappings
YAML Input
-
  name: Mark McGwire
  hr:   65
  avg:  0.278
-
  name: Sammy Sosa
  hr:   63
  avg:  0.288
Event Tree Output
+STR
+DOC
+SEQ
+MAP
=VAL :name
=VAL :Mark McGwire
=VAL :hr
=VAL :65
=VAL :avg
=VAL :0.278
-MAP
+MAP
=VAL :name
=VAL :Sammy Sosa
=VAL :hr
=VAL :63
=VAL :avg
=VAL :0.288
-MAP
-SEQ
-DOC
-STR
Expected JSON
[
  {
    "name": "Mark McGwire",
    "hr": 65,
    "avg": 0.278
  },
  {
    "name": "Sammy Sosa",
    "hr": 63,
    "avg": 0.288
  }
]
Actual JSON
[
  {
    "name": "Mark McGwire",
    "hr": 65,
    "avg": 0.278
  },
  {
    "name": "Sammy Sosa",
    "hr": 63,
    "avg": 0.288
  }
]
PASS JSON: SKIP 236B Invalid value after mapping Error Test
YAML Input
foo:
  bar
invalid
Event Tree Output
Yamlrw error: expected mapping key at line 3, columns 1-1
PASS JSON: PASS 26DV Whitespace around colon in mappings
YAML Input
"top1" : 
  "key1" : &alias1 scalar1
'top2' : 
  'key2' : &alias2 scalar2
top3: &node3 
  *alias1 : scalar3
top4: 
  *alias2 : scalar4
top5   :    
  scalar5
top6: 
  &anchor6 'key6' : scalar6
Event Tree Output
+STR
+DOC
+MAP
=VAL "top1
+MAP
=VAL "key1
=VAL &alias1 :scalar1
-MAP
=VAL 'top2
+MAP
=VAL 'key2
=VAL &alias2 :scalar2
-MAP
=VAL :top3
+MAP &node3
=ALI *alias1
=VAL :scalar3
-MAP
=VAL :top4
+MAP
=ALI *alias2
=VAL :scalar4
-MAP
=VAL :top5
=VAL :scalar5
=VAL :top6
+MAP
=VAL &anchor6 'key6
=VAL :scalar6
-MAP
-MAP
-DOC
-STR
Expected JSON
{
  "top1": {
    "key1": "scalar1"
  },
  "top2": {
    "key2": "scalar2"
  },
  "top3": {
    "scalar1": "scalar3"
  },
  "top4": {
    "scalar2": "scalar4"
  },
  "top5": "scalar5",
  "top6": {
    "key6": "scalar6"
  }
}
Actual JSON
{
  "top1": {
    "key1": "scalar1"
  },
  "top2": {
    "key2": "scalar2"
  },
  "top3": {
    "scalar1": "scalar3"
  },
  "top4": {
    "scalar2": "scalar4"
  },
  "top5": "scalar5",
  "top6": {
    "key6": "scalar6"
  }
}
PASS JSON: PASS 27NA Spec Example 5.9. Directive Indicator
YAML Input
%YAML 1.2
--- text
Event Tree Output
+STR
+DOC ---
=VAL :text
-DOC
-STR
Expected JSON
"text"
Actual JSON
"text"
PASS JSON: PASS 2AUY Tags in Block Sequence
YAML Input
 - !!str a
 - b
 - !!int 42
 - d
Event Tree Output
+STR
+DOC
+SEQ
=VAL <tag:yaml.org,2002:str> :a
=VAL :b
=VAL <tag:yaml.org,2002:int> :42
=VAL :d
-SEQ
-DOC
-STR
Expected JSON
[
  "a",
  "b",
  42,
  "d"
]
Actual JSON
[
  "a",
  "b",
  42,
  "d"
]
PASS JSON: SKIP 2CMS Invalid mapping in plain multiline Error Test
YAML Input
this
 is
  invalid: x
Event Tree Output
Yamlrw error: expected mapping key at line 3, columns 10-10
PASS JSON: PASS 2EBW Allowed characters in keys
YAML Input
a!"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~: safe
?foo: safe question mark
:foo: safe colon
-foo: safe dash
this is#not: a comment
Event Tree Output
+STR
+DOC
+MAP
=VAL :a!"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~
=VAL :safe
=VAL :?foo
=VAL :safe question mark
=VAL ::foo
=VAL :safe colon
=VAL :-foo
=VAL :safe dash
=VAL :this is#not
=VAL :a comment
-MAP
-DOC
-STR
Expected JSON
{
  "a!\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~": "safe",
  "?foo": "safe question mark",
  ":foo": "safe colon",
  "-foo": "safe dash",
  "this is#not": "a comment"
}
Actual JSON
{
  "a!\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~": "safe",
  "?foo": "safe question mark",
  ":foo": "safe colon",
  "-foo": "safe dash",
  "this is#not": "a comment"
}
PASS JSON: SKIP 2G84:00 Literal modifers Error Test
YAML Input
--- |0
Event Tree Output
Yamlrw error: invalid block scalar header: expected newline after header at line 1, columns 6-6
PASS JSON: SKIP 2G84:01 Literal modifers Error Test
YAML Input
--- |10
Event Tree Output
Yamlrw error: invalid block scalar header: expected newline after header at line 1, columns 7-7
PASS JSON: PASS 2G84:02 Literal modifers
YAML Input
--- |1-
Event Tree Output
+STR
+DOC ---
=VAL |
-DOC
-STR
Expected JSON
""
Actual JSON
""
PASS JSON: PASS 2G84:03 Literal modifers
YAML Input
--- |1+
Event Tree Output
+STR
+DOC ---
=VAL |
-DOC
-STR
Expected JSON
""
Actual JSON
""
PASS JSON: SKIP 2JQS Block Mapping with Missing Keys
YAML Input
: a
: b
Event Tree Output
+STR
+DOC
+MAP
=VAL :
=VAL :a
=VAL :
=VAL :b
-MAP
-DOC
-STR
PASS JSON: PASS 2LFX Spec Example 6.13. Reserved Directives [1.3]
YAML Input
%FOO  bar baz # Should be ignored
              # with a warning.
---
"foo"
Event Tree Output
+STR
+DOC ---
=VAL "foo
-DOC
-STR
Expected JSON
"foo"
Actual JSON
"foo"
PASS JSON: PASS 2SXE Anchors With Colon in Name
YAML Input
&a: key: &a value
foo:
  *a:
Event Tree Output
+STR
+DOC
+MAP
=VAL &a: :key
=VAL &a :value
=VAL :foo
=ALI *a:
-MAP
-DOC
-STR
Expected JSON
{
  "key": "value",
  "foo": "key"
}
Actual JSON
{
  "key": "value",
  "foo": "key"
}
PASS JSON: PASS 2XXW Spec Example 2.25. Unordered Sets
YAML Input
# Sets are represented as a
# Mapping where each key is
# associated with a null value
--- !!set
? Mark McGwire
? Sammy Sosa
? Ken Griff
Event Tree Output
+STR
+DOC ---
+MAP <tag:yaml.org,2002:set>
=VAL :Mark McGwire
=VAL :
=VAL :Sammy Sosa
=VAL :
=VAL :Ken Griff
=VAL :
-MAP
-DOC
-STR
Expected JSON
{
  "Mark McGwire": null,
  "Sammy Sosa": null,
  "Ken Griff": null
}
Actual JSON
{
  "Mark McGwire": null,
  "Sammy Sosa": null,
  "Ken Griff": null
}
PASS JSON: PASS 33X3 Three explicit integers in a block sequence
YAML Input
---
- !!int 1
- !!int -2
- !!int 33
Event Tree Output
+STR
+DOC ---
+SEQ
=VAL <tag:yaml.org,2002:int> :1
=VAL <tag:yaml.org,2002:int> :-2
=VAL <tag:yaml.org,2002:int> :33
-SEQ
-DOC
-STR
Expected JSON
[
  1,
  -2,
  33
]
Actual JSON
[
  1,
  -2,
  33
]
PASS JSON: PASS 35KP Tags for Root Objects
YAML Input
--- !!map
? a
: b
--- !!seq
- !!str c
--- !!str
d
e
Event Tree Output
+STR
+DOC ---
+MAP <tag:yaml.org,2002:map>
=VAL :a
=VAL :b
-MAP
-DOC
+DOC ---
+SEQ <tag:yaml.org,2002:seq>
=VAL <tag:yaml.org,2002:str> :c
-SEQ
-DOC
+DOC ---
=VAL <tag:yaml.org,2002:str> :d e
-DOC
-STR
Expected JSON
{
  "a": "b"
}
[
  "c"
]
"d e"
Actual JSON
{
  "a": "b"
}
[
  "c"
]
"d e"
PASS JSON: PASS 36F6 Multiline plain scalar with empty line
YAML Input
---
plain: a
 b

 c
Event Tree Output
+STR
+DOC ---
+MAP
=VAL :plain
=VAL :a b\nc
-MAP
-DOC
-STR
Expected JSON
{
  "plain": "a b\nc"
}
Actual JSON
{
  "plain": "a b\nc"
}
PASS JSON: PASS 3ALJ Block Sequence in Block Sequence
YAML Input
- - s1_i1
  - s1_i2
- s2
Event Tree Output
+STR
+DOC
+SEQ
+SEQ
=VAL :s1_i1
=VAL :s1_i2
-SEQ
=VAL :s2
-SEQ
-DOC
-STR
Expected JSON
[
  [
    "s1_i1",
    "s1_i2"
  ],
  "s2"
]
Actual JSON
[
  [
    "s1_i1",
    "s1_i2"
  ],
  "s2"
]
PASS JSON: PASS 3GZX Spec Example 7.1. Alias Nodes
YAML Input
First occurrence: &anchor Foo
Second occurrence: *anchor
Override anchor: &anchor Bar
Reuse anchor: *anchor
Event Tree Output
+STR
+DOC
+MAP
=VAL :First occurrence
=VAL &anchor :Foo
=VAL :Second occurrence
=ALI *anchor
=VAL :Override anchor
=VAL &anchor :Bar
=VAL :Reuse anchor
=ALI *anchor
-MAP
-DOC
-STR
Expected JSON
{
  "First occurrence": "Foo",
  "Second occurrence": "Foo",
  "Override anchor": "Bar",
  "Reuse anchor": "Bar"
}
Actual JSON
{
  "First occurrence": "Foo",
  "Second occurrence": "Foo",
  "Override anchor": "Bar",
  "Reuse anchor": "Bar"
}
PASS JSON: SKIP 3HFZ Invalid content after document end marker Error Test
YAML Input
---
key: value
... invalid
Event Tree Output
Yamlrw error: invalid directive: content not allowed after document end marker on same line at line 3, columns 1-1
PASS JSON: PASS 3MYT Plain Scalar looking like key, comment, anchor and tag
YAML Input
---
k:#foo
 &a !t s
Event Tree Output
+STR
+DOC ---
=VAL :k:#foo &a !t s
-DOC
-STR
Expected JSON
"k:#foo &a !t s"
Actual JSON
"k:#foo &a !t s"
PASS JSON: PASS 3R3P Single block sequence with anchor
YAML Input
&sequence
- a
Event Tree Output
+STR
+DOC
+SEQ &sequence
=VAL :a
-SEQ
-DOC
-STR
Expected JSON
[
  "a"
]
Actual JSON
[
  "a"
]
PASS JSON: PASS 3RLN:00 Leading tabs in double quoted
YAML Input
"1 leading
    \ttab"
Event Tree Output
+STR
+DOC
=VAL "1 leading \ttab
-DOC
-STR
Expected JSON
"1 leading \ttab"
Actual JSON
"1 leading \ttab"
PASS JSON: PASS 3RLN:01 Leading tabs in double quoted
YAML Input
"2 leading
    \	tab"
Event Tree Output
+STR
+DOC
=VAL "2 leading \ttab
-DOC
-STR
Expected JSON
"2 leading \ttab"
Actual JSON
"2 leading \ttab"
PASS JSON: PASS 3RLN:02 Leading tabs in double quoted
YAML Input
"3 leading
    	tab"
Event Tree Output
+STR
+DOC
=VAL "3 leading tab
-DOC
-STR
Expected JSON
"3 leading tab"
Actual JSON
"3 leading tab"
PASS JSON: PASS 3RLN:03 Leading tabs in double quoted
YAML Input
"4 leading
    \t  tab"
Event Tree Output
+STR
+DOC
=VAL "4 leading \t  tab
-DOC
-STR
Expected JSON
"4 leading \t  tab"
Actual JSON
"4 leading \t  tab"
PASS JSON: PASS 3RLN:04 Leading tabs in double quoted
YAML Input
"5 leading
    \	  tab"
Event Tree Output
+STR
+DOC
=VAL "5 leading \t  tab
-DOC
-STR
Expected JSON
"5 leading \t  tab"
Actual JSON
"5 leading \t  tab"
PASS JSON: PASS 3RLN:05 Leading tabs in double quoted
YAML Input
"6 leading
    	  tab"
Event Tree Output
+STR
+DOC
=VAL "6 leading tab
-DOC
-STR
Expected JSON
"6 leading tab"
Actual JSON
"6 leading tab"
PASS JSON: PASS 3UYS Escaped slash in double quotes
YAML Input
escaped slash: "a\/b"
Event Tree Output
+STR
+DOC
+MAP
=VAL :escaped slash
=VAL "a/b
-MAP
-DOC
-STR
Expected JSON
{
  "escaped slash": "a/b"
}
Actual JSON
{
  "escaped slash": "a/b"
}
PASS JSON: SKIP 4ABK Flow Mapping Separate Values
YAML Input
{
unquoted : "separate",
http://foo.com,
omitted value:,
}
Event Tree Output
+STR
+DOC
+MAP {}
=VAL :unquoted
=VAL "separate
=VAL :http://foo.com
=VAL :
=VAL :omitted value
=VAL :
-MAP
-DOC
-STR
PASS JSON: PASS 4CQQ Spec Example 2.18. Multi-line Flow Scalars
YAML Input
plain:
  This unquoted scalar
  spans many lines.

quoted: "So does this
  quoted scalar.\n"
Event Tree Output
+STR
+DOC
+MAP
=VAL :plain
=VAL :This unquoted scalar spans many lines.
=VAL :quoted
=VAL "So does this quoted scalar.\n
-MAP
-DOC
-STR
Expected JSON
{
  "plain": "This unquoted scalar spans many lines.",
  "quoted": "So does this quoted scalar.\n"
}
Actual JSON
{
  "plain": "This unquoted scalar spans many lines.",
  "quoted": "So does this quoted scalar.\n"
}
PASS JSON: SKIP 4EJS Invalid tabs as indendation in a mapping Error Test
YAML Input
---
a:
	b:
		c: value
Event Tree Output
Yamlrw error: tab character in indentation at line 3, columns 1-1
PASS JSON: SKIP 4FJ6 Nested implicit complex keys
YAML Input
---
[
  [ a, [ [[b,c]]: d, e]]: 23
]
Event Tree Output
+STR
+DOC ---
+SEQ []
+MAP {}
+SEQ []
=VAL :a
+SEQ []
+MAP {}
+SEQ []
+SEQ []
=VAL :b
=VAL :c
-SEQ
-SEQ
=VAL :d
-MAP
=VAL :e
-SEQ
-SEQ
=VAL :23
-MAP
-SEQ
-DOC
-STR
PASS JSON: PASS 4GC6 Spec Example 7.7. Single Quoted Characters
YAML Input
'here''s to "quotes"'
Event Tree Output
+STR
+DOC
=VAL 'here's to "quotes"
-DOC
-STR
Expected JSON
"here's to \"quotes\""
Actual JSON
"here's to \"quotes\""
PASS JSON: SKIP 4H7K Flow sequence with invalid extra closing bracket Error Test
YAML Input
---
[ a, b, c ] ]
Event Tree Output
Yamlrw error: unexpected token: content not allowed after document value at line 2, columns 13-14
PASS JSON: SKIP 4HVU Wrong indendation in Sequence Error Test
YAML Input
key:
   - ok
   - also ok
  - wrong
Event Tree Output
Yamlrw error: expected mapping key at line 4, columns 3-3
PASS JSON: SKIP 4JVG Scalar value with two anchors Error Test
YAML Input
top1: &node1
  &k1 key1: val1
top2: &node2
  &v2 val2
Event Tree Output
Yamlrw error: duplicate anchor: &v2 at line 4, columns 3-6
PASS JSON: PASS 4MUZ:00 Flow mapping colon on line after key
YAML Input
{"foo"
: "bar"}
Event Tree Output
+STR
+DOC
+MAP {}
=VAL "foo
=VAL "bar
-MAP
-DOC
-STR
Expected JSON
{
  "foo": "bar"
}
Actual JSON
{
  "foo": "bar"
}
PASS JSON: PASS 4MUZ:01 Flow mapping colon on line after key
YAML Input
{"foo"
: bar}
Event Tree Output
+STR
+DOC
+MAP {}
=VAL "foo
=VAL :bar
-MAP
-DOC
-STR
Expected JSON
{
  "foo": "bar"
}
Actual JSON
{
  "foo": "bar"
}
PASS JSON: PASS 4MUZ:02 Flow mapping colon on line after key
YAML Input
{foo
: bar}
Event Tree Output
+STR
+DOC
+MAP {}
=VAL :foo
=VAL :bar
-MAP
-DOC
-STR
Expected JSON
{
  "foo": "bar"
}
Actual JSON
{
  "foo": "bar"
}
PASS JSON: PASS 4Q9F Folded Block Scalar [1.3]
YAML Input
--- >
 ab
 cd
 
 ef


 gh
Event Tree Output
+STR
+DOC ---
=VAL >ab cd\nef\n\ngh\n
-DOC
-STR
Expected JSON
"ab cd\nef\n\ngh\n"
Actual JSON
"ab cd\nef\n\ngh\n"
PASS JSON: PASS 4QFQ Spec Example 8.2. Block Indentation Indicator [1.3]
YAML Input
- |
 detected
- >
 
  
  # detected
- |1
  explicit
- >
 detected
Event Tree Output
+STR
+DOC
+SEQ
=VAL |detected\n
=VAL >\n\n# detected\n
=VAL | explicit\n
=VAL >detected\n
-SEQ
-DOC
-STR
Expected JSON
[
  "detected\n",
  "\n\n# detected\n",
  " explicit\n",
  "detected\n"
]
Actual JSON
[
  "detected\n",
  "\n\n# detected\n",
  " explicit\n",
  "detected\n"
]
PASS JSON: PASS 4RWC Trailing spaces after flow collection
YAML Input
  [1, 2, 3]  
  
Event Tree Output
+STR
+DOC
+SEQ []
=VAL :1
=VAL :2
=VAL :3
-SEQ
-DOC
-STR
Expected JSON
[
  1,
  2,
  3
]
Actual JSON
[
  1,
  2,
  3
]
PASS JSON: PASS 4UYU Colon in Double Quoted String
YAML Input
"foo: bar\": baz"
Event Tree Output
+STR
+DOC
=VAL "foo: bar": baz
-DOC
-STR
Expected JSON
"foo: bar\": baz"
Actual JSON
"foo: bar\": baz"
PASS JSON: PASS 4V8U Plain scalar with backslashes
YAML Input
---
plain\value\with\backslashes
Event Tree Output
+STR
+DOC ---
=VAL :plain\\value\\with\\backslashes
-DOC
-STR
Expected JSON
"plain\\value\\with\\backslashes"
Actual JSON
"plain\\value\\with\\backslashes"
PASS JSON: PASS 4WA9 Literal scalars
YAML Input
- aaa: |2
    xxx
  bbb: |
    xxx
Event Tree Output
+STR
+DOC
+SEQ
+MAP
=VAL :aaa
=VAL |xxx\n
=VAL :bbb
=VAL |xxx\n
-MAP
-SEQ
-DOC
-STR
Expected JSON
[
  {
    "aaa" : "xxx\n",
    "bbb" : "xxx\n"
  }
]
Actual JSON
[
  {
    "aaa": "xxx\n",
    "bbb": "xxx\n"
  }
]
PASS JSON: PASS 4ZYM Spec Example 6.4. Line Prefixes
YAML Input
plain: text
  lines
quoted: "text
  	lines"
block: |
  text
   	lines
Event Tree Output
+STR
+DOC
+MAP
=VAL :plain
=VAL :text lines
=VAL :quoted
=VAL "text lines
=VAL :block
=VAL |text\n \tlines\n
-MAP
-DOC
-STR
Expected JSON
{
  "plain": "text lines",
  "quoted": "text lines",
  "block": "text\n \tlines\n"
}
Actual JSON
{
  "plain": "text lines",
  "quoted": "text lines",
  "block": "text\n \tlines\n"
}
PASS JSON: PASS 52DL Explicit Non-Specific Tag [1.3]
YAML Input
---
! a
Event Tree Output
+STR
+DOC ---
=VAL <!> :a
-DOC
-STR
Expected JSON
"a"
Actual JSON
"a"
PASS JSON: PASS 54T7 Flow Mapping
YAML Input
{foo: you, bar: far}
Event Tree Output
+STR
+DOC
+MAP {}
=VAL :foo
=VAL :you
=VAL :bar
=VAL :far
-MAP
-DOC
-STR
Expected JSON
{
  "foo": "you",
  "bar": "far"
}
Actual JSON
{
  "foo": "you",
  "bar": "far"
}
PASS JSON: SKIP 55WF Invalid escape in double quoted string Error Test
YAML Input
---
"\."
Event Tree Output
Yamlrw error: invalid escape sequence: \. at line 2, columns 3-3
PASS JSON: PASS 565N Construct Binary
YAML Input
canonical: !!binary "\
 R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\
 OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\
 +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\
 AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs="
generic: !!binary |
 R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5
 OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+
 +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC
 AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=
description:
 The binary value above is a tiny arrow encoded as a gif image.
Event Tree Output
+STR
+DOC
+MAP
=VAL :canonical
=VAL <tag:yaml.org,2002:binary> "R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLCAgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=
=VAL :generic
=VAL <tag:yaml.org,2002:binary> |R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\nOTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\n+f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\nAgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=\n
=VAL :description
=VAL :The binary value above is a tiny arrow encoded as a gif image.
-MAP
-DOC
-STR
Expected JSON
{
  "canonical": "R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLCAgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=",
  "generic": "R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\nOTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\n+f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\nAgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=\n",
  "description": "The binary value above is a tiny arrow encoded as a gif image."
}
Actual JSON
{
  "canonical": "R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLCAgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=",
  "generic": "R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\nOTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\n+f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\nAgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=\n",
  "description": "The binary value above is a tiny arrow encoded as a gif image."
}
PASS JSON: PASS 57H4 Spec Example 8.22. Block Collection Nodes
YAML Input
sequence: !!seq
- entry
- !!seq
 - nested
mapping: !!map
 foo: bar
Event Tree Output
+STR
+DOC
+MAP
=VAL :sequence
+SEQ <tag:yaml.org,2002:seq>
=VAL :entry
+SEQ <tag:yaml.org,2002:seq>
=VAL :nested
-SEQ
-SEQ
=VAL :mapping
+MAP <tag:yaml.org,2002:map>
=VAL :foo
=VAL :bar
-MAP
-MAP
-DOC
-STR
Expected JSON
{
  "sequence": [
    "entry",
    [
      "nested"
    ]
  ],
  "mapping": {
    "foo": "bar"
  }
}
Actual JSON
{
  "sequence": [
    "entry",
    [
      "nested"
    ]
  ],
  "mapping": {
    "foo": "bar"
  }
}
PASS JSON: PASS 58MP Flow mapping edge cases
YAML Input
{x: :x}
Event Tree Output
+STR
+DOC
+MAP {}
=VAL :x
=VAL ::x
-MAP
-DOC
-STR
Expected JSON
{
  "x": ":x"
}
Actual JSON
{
  "x": ":x"
}
PASS JSON: PASS 5BVJ Spec Example 5.7. Block Scalar Indicators
YAML Input
literal: |
  some
  text
folded: >
  some
  text
Event Tree Output
+STR
+DOC
+MAP
=VAL :literal
=VAL |some\ntext\n
=VAL :folded
=VAL >some text\n
-MAP
-DOC
-STR
Expected JSON
{
  "literal": "some\ntext\n",
  "folded": "some text\n"
}
Actual JSON
{
  "literal": "some\ntext\n",
  "folded": "some text\n"
}
PASS JSON: PASS 5C5M Spec Example 7.15. Flow Mappings
YAML Input
- { one : two , three: four , }
- {five: six,seven : eight}
Event Tree Output
+STR
+DOC
+SEQ
+MAP {}
=VAL :one
=VAL :two
=VAL :three
=VAL :four
-MAP
+MAP {}
=VAL :five
=VAL :six
=VAL :seven
=VAL :eight
-MAP
-SEQ
-DOC
-STR
Expected JSON
[
  {
    "one": "two",
    "three": "four"
  },
  {
    "five": "six",
    "seven": "eight"
  }
]
Actual JSON
[
  {
    "one": "two",
    "three": "four"
  },
  {
    "five": "six",
    "seven": "eight"
  }
]
PASS JSON: PASS 5GBF Spec Example 6.5. Empty Lines
YAML Input
Folding:
  "Empty line
   	
  as a line feed"
Chomping: |
  Clipped empty lines
 

Event Tree Output
+STR
+DOC
+MAP
=VAL :Folding
=VAL "Empty line\nas a line feed
=VAL :Chomping
=VAL |Clipped empty lines\n
-MAP
-DOC
-STR
Expected JSON
{
  "Folding": "Empty line\nas a line feed",
  "Chomping": "Clipped empty lines\n"
}
Actual JSON
{
  "Folding": "Empty line\nas a line feed",
  "Chomping": "Clipped empty lines\n"
}
PASS JSON: PASS 5KJE Spec Example 7.13. Flow Sequence
YAML Input
- [ one, two, ]
- [three ,four]
Event Tree Output
+STR
+DOC
+SEQ
+SEQ []
=VAL :one
=VAL :two
-SEQ
+SEQ []
=VAL :three
=VAL :four
-SEQ
-SEQ
-DOC
-STR
Expected JSON
[
  [
    "one",
    "two"
  ],
  [
    "three",
    "four"
  ]
]
Actual JSON
[
  [
    "one",
    "two"
  ],
  [
    "three",
    "four"
  ]
]
PASS JSON: SKIP 5LLU Block scalar with wrong indented line after spaces only Error Test
YAML Input
block scalar: >
 
  
   
 invalid
Event Tree Output
Yamlrw error: invalid block scalar header: wrongly indented line in block scalar at line 5, columns 2-2
PASS JSON: PASS 5MUD Colon and adjacent value on next line
YAML Input
---
{ "foo"
  :bar }
Event Tree Output
+STR
+DOC ---
+MAP {}
=VAL "foo
=VAL :bar
-MAP
-DOC
-STR
Expected JSON
{
  "foo": "bar"
}
Actual JSON
{
  "foo": "bar"
}
PASS JSON: PASS 5NYZ Spec Example 6.9. Separated Comment
YAML Input
key:    # Comment
  value
Event Tree Output
+STR
+DOC
+MAP
=VAL :key
=VAL :value
-MAP
-DOC
-STR
Expected JSON
{
  "key": "value"
}
Actual JSON
{
  "key": "value"
}
PASS JSON: PASS 5T43 Colon at the beginning of adjacent flow scalar
YAML Input
- { "key":value }
- { "key"::value }
Event Tree Output
+STR
+DOC
+SEQ
+MAP {}
=VAL "key
=VAL :value
-MAP
+MAP {}
=VAL "key
=VAL ::value
-MAP
-SEQ
-DOC
-STR
Expected JSON
[
  {
    "key": "value"
  },
  {
    "key": ":value"
  }
]
Actual JSON
[
  {
    "key": "value"
  },
  {
    "key": ":value"
  }
]
PASS JSON: SKIP 5TRB Invalid document-start marker in doublequoted tring Error Test
YAML Input
---
"
---
"
Event Tree Output
Yamlrw error: unclosed double quote at line 2, columns 1-1
PASS JSON: PASS 5TYM Spec Example 6.21. Local Tag Prefix
YAML Input
%TAG !m! !my-
--- # Bulb here
!m!light fluorescent
...
%TAG !m! !my-
--- # Color here
!m!light green
Event Tree Output
+STR
+DOC ---
=VAL <!my-light> :fluorescent
-DOC ...
+DOC ---
=VAL <!my-light> :green
-DOC
-STR
Expected JSON
"fluorescent"
"green"
Actual JSON
"fluorescent"
"green"
PASS JSON: SKIP 5U3A Sequence on same Line as Mapping Key Error Test
YAML Input
key: - a
     - b
Event Tree Output
Yamlrw error: block sequence entries are not allowed in this context at line 1, columns 6-6
PASS JSON: PASS 5WE3 Spec Example 8.17. Explicit Block Mapping Entries
YAML Input
? explicit key # Empty value
? |
  block key
: - one # Explicit compact
  - two # block value
Event Tree Output
+STR
+DOC
+MAP
=VAL :explicit key
=VAL :
=VAL |block key\n
+SEQ
=VAL :one
=VAL :two
-SEQ
-MAP
-DOC
-STR
Expected JSON
{
  "explicit key": null,
  "block key\n": [
    "one",
    "two"
  ]
}
Actual JSON
{
  "explicit key": null,
  "block key\n": [
    "one",
    "two"
  ]
}
PASS JSON: SKIP 62EZ Invalid block mapping key on same line as previous key Error Test
YAML Input
---
x: { y: z }in: valid
Event Tree Output
Yamlrw error: expected mapping key at line 2, columns 12-14
PASS JSON: PASS 652Z Question mark at start of flow key
YAML Input
{ ?foo: bar,
bar: 42
}
Event Tree Output
+STR
+DOC
+MAP {}
=VAL :?foo
=VAL :bar
=VAL :bar
=VAL :42
-MAP
-DOC
-STR
Expected JSON
{
  "?foo" : "bar",
  "bar" : 42
}
Actual JSON
{
  "?foo": "bar",
  "bar": 42
}
PASS JSON: PASS 65WH Single Entry Block Sequence
YAML Input
- foo
Event Tree Output
+STR
+DOC
+SEQ
=VAL :foo
-SEQ
-DOC
-STR
Expected JSON
[
  "foo"
]
Actual JSON
[
  "foo"
]
PASS JSON: PASS 6BCT Spec Example 6.3. Separation Spaces
YAML Input
- foo:	 bar
- - baz
  -	baz
Event Tree Output
+STR
+DOC
+SEQ
+MAP
=VAL :foo
=VAL :bar
-MAP
+SEQ
=VAL :baz
=VAL :baz
-SEQ
-SEQ
-DOC
-STR
Expected JSON
[
  {
    "foo": "bar"
  },
  [
    "baz",
    "baz"
  ]
]
Actual JSON
[
  {
    "foo": "bar"
  },
  [
    "baz",
    "baz"
  ]
]
PASS JSON: SKIP 6BFJ Mapping, key and flow sequence item anchors
YAML Input
---
&mapping
&key [ &item a, b, c ]: value
Event Tree Output
+STR
+DOC ---
+MAP &mapping
+SEQ [] &key
=VAL &item :a
=VAL :b
=VAL :c
-SEQ
=VAL :value
-MAP
-DOC
-STR
PASS JSON: PASS 6CA3 Tab indented top flow
YAML Input
	[
	]
Event Tree Output
+STR
+DOC
+SEQ []
-SEQ
-DOC
-STR
Expected JSON
[]
Actual JSON
[]
PASS JSON: PASS 6CK3 Spec Example 6.26. Tag Shorthands
YAML Input
%TAG !e! tag:example.com,2000:app/
---
- !local foo
- !!str bar
- !e!tag%21 baz
Event Tree Output
+STR
+DOC ---
+SEQ
=VAL <!local> :foo
=VAL <tag:yaml.org,2002:str> :bar
=VAL <tag:example.com,2000:app/tag!> :baz
-SEQ
-DOC
-STR
Expected JSON
[
  "foo",
  "bar",
  "baz"
]
Actual JSON
[
  "foo",
  "bar",
  "baz"
]
PASS JSON: PASS 6FWR Block Scalar Keep
YAML Input
--- |+
 ab
 
  
...
Event Tree Output
+STR
+DOC ---
=VAL |ab\n\n \n
-DOC ...
-STR
Expected JSON
"ab\n\n \n"
Actual JSON
"ab\n\n \n"
PASS JSON: PASS 6H3V Backslashes in singlequotes
YAML Input
'foo: bar\': baz'
Event Tree Output
+STR
+DOC
+MAP
=VAL 'foo: bar\\
=VAL :baz'
-MAP
-DOC
-STR
Expected JSON
{
  "foo: bar\\": "baz'"
}
Actual JSON
{
  "foo: bar\\": "baz'"
}
PASS JSON: PASS 6HB6 Spec Example 6.1. Indentation Spaces
YAML Input
  # Leading comment line spaces are
   # neither content nor indentation.
    
Not indented:
 By one space: |
    By four
      spaces
 Flow style: [    # Leading spaces
   By two,        # in flow style
  Also by two,    # are neither
  	Still by two   # content nor
    ]             # indentation.
Event Tree Output
+STR
+DOC
+MAP
=VAL :Not indented
+MAP
=VAL :By one space
=VAL |By four\n  spaces\n
=VAL :Flow style
+SEQ []
=VAL :By two
=VAL :Also by two
=VAL :Still by two
-SEQ
-MAP
-MAP
-DOC
-STR
Expected JSON
{
  "Not indented": {
    "By one space": "By four\n  spaces\n",
    "Flow style": [
      "By two",
      "Also by two",
      "Still by two"
    ]
  }
}
Actual JSON
{
  "Not indented": {
    "By one space": "By four\n  spaces\n",
    "Flow style": [
      "By two",
      "Also by two",
      "Still by two"
    ]
  }
}
PASS JSON: PASS 6JQW Spec Example 2.13. In literals, newlines are preserved
YAML Input
# ASCII Art
--- |
  \//||\/||
  // ||  ||__
Event Tree Output
+STR
+DOC ---
=VAL |\\//||\\/||\n// ||  ||__\n
-DOC
-STR
Expected JSON
"\\//||\\/||\n// ||  ||__\n"
Actual JSON
"\\//||\\/||\n// ||  ||__\n"
PASS JSON: SKIP 6JTT Flow sequence without closing bracket Error Test
YAML Input
---
[ [ a, b, c ]
Event Tree Output
Yamlrw error: expected sequence end ']' at line 3, columns 1-1
PASS JSON: PASS 6JWB Tags for Block Objects
YAML Input
foo: !!seq
  - !!str a
  - !!map
    key: !!str value
Event Tree Output
+STR
+DOC
+MAP
=VAL :foo
+SEQ <tag:yaml.org,2002:seq>
=VAL <tag:yaml.org,2002:str> :a
+MAP <tag:yaml.org,2002:map>
=VAL :key
=VAL <tag:yaml.org,2002:str> :value
-MAP
-SEQ
-MAP
-DOC
-STR
Expected JSON
{
  "foo": [
    "a",
    {
      "key": "value"
    }
  ]
}
Actual JSON
{
  "foo": [
    "a",
    {
      "key": "value"
    }
  ]
}
PASS JSON: PASS 6KGN Anchor for empty node
YAML Input
---
a: &anchor
b: *anchor
Event Tree Output
+STR
+DOC ---
+MAP
=VAL :a
=VAL &anchor :
=VAL :b
=ALI *anchor
-MAP
-DOC
-STR
Expected JSON
{
  "a": null,
  "b": null
}
Actual JSON
{
  "a": null,
  "b": null
}
PASS JSON: PASS 6LVF Spec Example 6.13. Reserved Directives
YAML Input
%FOO  bar baz # Should be ignored
              # with a warning.
--- "foo"
Event Tree Output
+STR
+DOC ---
=VAL "foo
-DOC
-STR
Expected JSON
"foo"
Actual JSON
"foo"
PASS JSON: SKIP 6M2F Aliases in Explicit Block Mapping
YAML Input
? &a a
: &b b
: *a
Event Tree Output
+STR
+DOC
+MAP
=VAL &a :a
=VAL &b :b
=VAL :
=ALI *a
-MAP
-DOC
-STR
PASS JSON: SKIP 6PBE Zero-indented sequences in explicit mapping keys
YAML Input
---
?
- a
- b
:
- c
- d
Event Tree Output
+STR
+DOC ---
+MAP
+SEQ
=VAL :a
=VAL :b
-SEQ
+SEQ
=VAL :c
=VAL :d
-SEQ
-MAP
-DOC
-STR
PASS JSON: SKIP 6S55 Invalid scalar at the end of sequence Error Test
YAML Input
key:
 - bar
 - baz
 invalid
Event Tree Output
Yamlrw error: expected mapping key at line 4, columns 2-2
PASS JSON: PASS 6SLA Allowed characters in quoted mapping key
YAML Input
"foo\nbar:baz\tx \\$%^&*()x": 23
'x\ny:z\tx $%^&*()x': 24
Event Tree Output
+STR
+DOC
+MAP
=VAL "foo\nbar:baz\tx \\$%^&*()x
=VAL :23
=VAL 'x\\ny:z\\tx $%^&*()x
=VAL :24
-MAP
-DOC
-STR
Expected JSON
{
  "foo\nbar:baz\tx \\$%^&*()x": 23,
  "x\\ny:z\\tx $%^&*()x": 24
}
Actual JSON
{
  "foo\nbar:baz\tx \\$%^&*()x": 23,
  "x\\ny:z\\tx $%^&*()x": 24
}
PASS JSON: PASS 6VJK Spec Example 2.15. Folded newlines are preserved for "more indented" and blank lines
YAML Input
>
 Sammy Sosa completed another
 fine season with great stats.

   63 Home Runs
   0.288 Batting Average

 What a year!
Event Tree Output
+STR
+DOC
=VAL >Sammy Sosa completed another fine season with great stats.\n\n  63 Home Runs\n  0.288 Batting Average\n\nWhat a year!\n
-DOC
-STR
Expected JSON
"Sammy Sosa completed another fine season with great stats.\n\n  63 Home Runs\n  0.288 Batting Average\n\nWhat a year!\n"
Actual JSON
"Sammy Sosa completed another fine season with great stats.\n\n  63 Home Runs\n  0.288 Batting Average\n\nWhat a year!\n"
PASS JSON: PASS 6WLZ Spec Example 6.18. Primary Tag Handle [1.3]
YAML Input
# Private
---
!foo "bar"
...
# Global
%TAG ! tag:example.com,2000:app/
---
!foo "bar"
Event Tree Output
+STR
+DOC ---
=VAL <!foo> "bar
-DOC ...
+DOC ---
=VAL <tag:example.com,2000:app/foo> "bar
-DOC
-STR
Expected JSON
"bar"
"bar"
Actual JSON
"bar"
"bar"
PASS JSON: PASS 6WPF Spec Example 6.8. Flow Folding [1.3]
YAML Input
---
"
  foo 
 
    bar

  baz
"
Event Tree Output
+STR
+DOC ---
=VAL " foo\nbar\nbaz 
-DOC
-STR
Expected JSON
" foo\nbar\nbaz "
Actual JSON
" foo\nbar\nbaz "
PASS JSON: PASS 6XDY Two document start markers
YAML Input
---
---
Event Tree Output
+STR
+DOC ---
=VAL :
-DOC
+DOC ---
=VAL :
-DOC
-STR
Expected JSON
null
null
Actual JSON
null
null
PASS JSON: PASS 6ZKB Spec Example 9.6. Stream
YAML Input
Document
---
# Empty
...
%YAML 1.2
---
matches %: 20
Event Tree Output
+STR
+DOC
=VAL :Document
-DOC
+DOC ---
=VAL :
-DOC ...
+DOC ---
+MAP
=VAL :matches %
=VAL :20
-MAP
-DOC
-STR
Expected JSON
"Document"
null
{
  "matches %": 20
}
Actual JSON
"Document"
null
{
  "matches %": 20
}
PASS JSON: PASS 735Y Spec Example 8.20. Block Node Types
YAML Input
-
  "flow in block"
- >
 Block scalar
- !!map # Block collection
  foo : bar
Event Tree Output
+STR
+DOC
+SEQ
=VAL "flow in block
=VAL >Block scalar\n
+MAP <tag:yaml.org,2002:map>
=VAL :foo
=VAL :bar
-MAP
-SEQ
-DOC
-STR
Expected JSON
[
  "flow in block",
  "Block scalar\n",
  {
    "foo": "bar"
  }
]
Actual JSON
[
  "flow in block",
  "Block scalar\n",
  {
    "foo": "bar"
  }
]
PASS JSON: PASS 74H7 Tags in Implicit Mapping
YAML Input
!!str a: b
c: !!int 42
e: !!str f
g: h
!!str 23: !!bool false
Event Tree Output
+STR
+DOC
+MAP
=VAL <tag:yaml.org,2002:str> :a
=VAL :b
=VAL :c
=VAL <tag:yaml.org,2002:int> :42
=VAL :e
=VAL <tag:yaml.org,2002:str> :f
=VAL :g
=VAL :h
=VAL <tag:yaml.org,2002:str> :23
=VAL <tag:yaml.org,2002:bool> :false
-MAP
-DOC
-STR
Expected JSON
{
  "a": "b",
  "c": 42,
  "e": "f",
  "g": "h",
  "23": false
}
Actual JSON
{
  "a": "b",
  "c": 42,
  "e": "f",
  "g": "h",
  "23": false
}
PASS JSON: PASS 753E Block Scalar Strip [1.3]
YAML Input
--- |-
 ab
 
 
...
Event Tree Output
+STR
+DOC ---
=VAL |ab
-DOC ...
-STR
Expected JSON
"ab"
Actual JSON
"ab"
PASS JSON: PASS 7A4E Spec Example 7.6. Double Quoted Lines
YAML Input
" 1st non-empty

 2nd non-empty 
	3rd non-empty "
Event Tree Output
+STR
+DOC
=VAL " 1st non-empty\n2nd non-empty 3rd non-empty 
-DOC
-STR
Expected JSON
" 1st non-empty\n2nd non-empty 3rd non-empty "
Actual JSON
" 1st non-empty\n2nd non-empty 3rd non-empty "
PASS JSON: PASS 7BMT Node and Mapping Key Anchors [1.3]
YAML Input
---
top1: &node1
  &k1 key1: one
top2: &node2 # comment
  key2: two
top3:
  &k3 key3: three
top4: &node4
  &k4 key4: four
top5: &node5
  key5: five
top6: &val6
  six
top7:
  &val7 seven
Event Tree Output
+STR
+DOC ---
+MAP
=VAL :top1
+MAP &node1
=VAL &k1 :key1
=VAL :one
-MAP
=VAL :top2
+MAP &node2
=VAL :key2
=VAL :two
-MAP
=VAL :top3
+MAP
=VAL &k3 :key3
=VAL :three
-MAP
=VAL :top4
+MAP &node4
=VAL &k4 :key4
=VAL :four
-MAP
=VAL :top5
+MAP &node5
=VAL :key5
=VAL :five
-MAP
=VAL :top6
=VAL &val6 :six
=VAL :top7
=VAL &val7 :seven
-MAP
-DOC
-STR
Expected JSON
{
  "top1": {
    "key1": "one"
  },
  "top2": {
    "key2": "two"
  },
  "top3": {
    "key3": "three"
  },
  "top4": {
    "key4": "four"
  },
  "top5": {
    "key5": "five"
  },
  "top6": "six",
  "top7": "seven"
}
Actual JSON
{
  "top1": {
    "key1": "one"
  },
  "top2": {
    "key2": "two"
  },
  "top3": {
    "key3": "three"
  },
  "top4": {
    "key4": "four"
  },
  "top5": {
    "key5": "five"
  },
  "top6": "six",
  "top7": "seven"
}
PASS JSON: PASS 7BUB Spec Example 2.10. Node for “Sammy Sosa” appears twice in this document
YAML Input
---
hr:
  - Mark McGwire
  # Following node labeled SS
  - &SS Sammy Sosa
rbi:
  - *SS # Subsequent occurrence
  - Ken Griffey
Event Tree Output
+STR
+DOC ---
+MAP
=VAL :hr
+SEQ
=VAL :Mark McGwire
=VAL &SS :Sammy Sosa
-SEQ
=VAL :rbi
+SEQ
=ALI *SS
=VAL :Ken Griffey
-SEQ
-MAP
-DOC
-STR
Expected JSON
{
  "hr": [
    "Mark McGwire",
    "Sammy Sosa"
  ],
  "rbi": [
    "Sammy Sosa",
    "Ken Griffey"
  ]
}
Actual JSON
{
  "hr": [
    "Mark McGwire",
    "Sammy Sosa"
  ],
  "rbi": [
    "Sammy Sosa",
    "Ken Griffey"
  ]
}
PASS JSON: PASS 7FWL Spec Example 6.24. Verbatim Tags
YAML Input
!<tag:yaml.org,2002:str> foo :
  !<!bar> baz
Event Tree Output
+STR
+DOC
+MAP
=VAL <tag:yaml.org,2002:str> :foo
=VAL <!bar> :baz
-MAP
-DOC
-STR
Expected JSON
{
  "foo": "baz"
}
Actual JSON
{
  "foo": "baz"
}
PASS JSON: SKIP 7LBH Multiline double quoted implicit keys Error Test
YAML Input
"a\nb": 1
"c
 d": 1
Event Tree Output
Yamlrw error: expected mapping key at line 2, columns 1-1
PASS JSON: SKIP 7MNF Missing colon Error Test
YAML Input
top1:
  key1: val1
top2
Event Tree Output
Yamlrw error: expected mapping key at line 3, columns 1-1
PASS JSON: PASS 7T8X Spec Example 8.10. Folded Lines - 8.13. Final Empty Lines
YAML Input
>

 folded
 line

 next
 line
   * bullet

   * list
   * lines

 last
 line

# Comment
Event Tree Output
+STR
+DOC
=VAL >\nfolded line\nnext line\n  * bullet\n\n  * list\n  * lines\n\nlast line\n
-DOC
-STR
Expected JSON
"\nfolded line\nnext line\n  * bullet\n\n  * list\n  * lines\n\nlast line\n"
Actual JSON
"\nfolded line\nnext line\n  * bullet\n\n  * list\n  * lines\n\nlast line\n"
PASS JSON: PASS 7TMG Comment in flow sequence before comma
YAML Input
---
[ word1
# comment
, word2]
Event Tree Output
+STR
+DOC ---
+SEQ []
=VAL :word1
=VAL :word2
-SEQ
-DOC
-STR
Expected JSON
[
  "word1",
  "word2"
]
Actual JSON
[
  "word1",
  "word2"
]
PASS JSON: PASS 7W2P Block Mapping with Missing Values
YAML Input
? a
? b
c:
Event Tree Output
+STR
+DOC
+MAP
=VAL :a
=VAL :
=VAL :b
=VAL :
=VAL :c
=VAL :
-MAP
-DOC
-STR
Expected JSON
{
  "a": null,
  "b": null,
  "c": null
}
Actual JSON
{
  "a": null,
  "b": null,
  "c": null
}
PASS JSON: PASS 7Z25 Bare document after document end marker
YAML Input
---
scalar1
...
key: value
Event Tree Output
+STR
+DOC ---
=VAL :scalar1
-DOC ...
+DOC
+MAP
=VAL :key
=VAL :value
-MAP
-DOC
-STR
Expected JSON
"scalar1"
{
  "key": "value"
}
Actual JSON
"scalar1"
{
  "key": "value"
}
PASS JSON: PASS 7ZZ5 Empty flow collections
YAML Input
---
nested sequences:
- - - []
- - - {}
key1: []
key2: {}
Event Tree Output
+STR
+DOC ---
+MAP
=VAL :nested sequences
+SEQ
+SEQ
+SEQ
+SEQ []
-SEQ
-SEQ
-SEQ
+SEQ
+SEQ
+MAP {}
-MAP
-SEQ
-SEQ
-SEQ
=VAL :key1
+SEQ []
-SEQ
=VAL :key2
+MAP {}
-MAP
-MAP
-DOC
-STR
Expected JSON
{
  "nested sequences": [
    [
      [
        []
      ]
    ],
    [
      [
        {}
      ]
    ]
  ],
  "key1": [],
  "key2": {}
}
Actual JSON
{
  "nested sequences": [
    [
      [
        []
      ]
    ],
    [
      [
        {}
      ]
    ]
  ],
  "key1": [],
  "key2": {}
}
PASS JSON: PASS 82AN Three dashes and content without space
YAML Input
---word1
word2
Event Tree Output
+STR
+DOC
=VAL :---word1 word2
-DOC
-STR
Expected JSON
"---word1 word2"
Actual JSON
"---word1 word2"
PASS JSON: PASS 87E4 Spec Example 7.8. Single Quoted Implicit Keys
YAML Input
'implicit block key' : [
  'implicit flow key' : value,
 ]
Event Tree Output
+STR
+DOC
+MAP
=VAL 'implicit block key
+SEQ []
+MAP {}
=VAL 'implicit flow key
=VAL :value
-MAP
-SEQ
-MAP
-DOC
-STR
Expected JSON
{
  "implicit block key": [
    {
      "implicit flow key": "value"
    }
  ]
}
Actual JSON
{
  "implicit block key": [
    {
      "implicit flow key": "value"
    }
  ]
}
PASS JSON: PASS 8CWC Plain mapping key ending with colon
YAML Input
---
key ends with two colons::: value
Event Tree Output
+STR
+DOC ---
+MAP
=VAL :key ends with two colons::
=VAL :value
-MAP
-DOC
-STR
Expected JSON
{
  "key ends with two colons::": "value"
}
Actual JSON
{
  "key ends with two colons::": "value"
}
PASS JSON: PASS 8G76 Spec Example 6.10. Comment Lines
YAML Input
  # Comment
   


Event Tree Output
+STR
-STR
PASS JSON: PASS 8KB6 Multiline plain flow mapping key without value
YAML Input
---
- { single line, a: b}
- { multi
  line, a: b}
Event Tree Output
+STR
+DOC ---
+SEQ
+MAP {}
=VAL :single line
=VAL :
=VAL :a
=VAL :b
-MAP
+MAP {}
=VAL :multi line
=VAL :
=VAL :a
=VAL :b
-MAP
-SEQ
-DOC
-STR
Expected JSON
[
  {
    "single line": null,
    "a": "b"
  },
  {
    "multi line": null,
    "a": "b"
  }
]
Actual JSON
[
  {
    "single line": null,
    "a": "b"
  },
  {
    "multi line": null,
    "a": "b"
  }
]
PASS JSON: PASS 8MK2 Explicit Non-Specific Tag
YAML Input
! a
Event Tree Output
+STR
+DOC
=VAL <!> :a
-DOC
-STR
Expected JSON
"a"
Actual JSON
"a"
PASS JSON: PASS 8QBE Block Sequence in Block Mapping
YAML Input
key:
 - item1
 - item2
Event Tree Output
+STR
+DOC
+MAP
=VAL :key
+SEQ
=VAL :item1
=VAL :item2
-SEQ
-MAP
-DOC
-STR
Expected JSON
{
  "key": [
    "item1",
    "item2"
  ]
}
Actual JSON
{
  "key": [
    "item1",
    "item2"
  ]
}
PASS JSON: PASS 8UDB Spec Example 7.14. Flow Sequence Entries
YAML Input
[
"double
 quoted", 'single
           quoted',
plain
 text, [ nested ],
single: pair,
]
Event Tree Output
+STR
+DOC
+SEQ []
=VAL "double quoted
=VAL 'single quoted
=VAL :plain text
+SEQ []
=VAL :nested
-SEQ
+MAP {}
=VAL :single
=VAL :pair
-MAP
-SEQ
-DOC
-STR
Expected JSON
[
  "double quoted",
  "single quoted",
  "plain text",
  [
    "nested"
  ],
  {
    "single": "pair"
  }
]
Actual JSON
[
  "double quoted",
  "single quoted",
  "plain text",
  [
    "nested"
  ],
  {
    "single": "pair"
  }
]
PASS JSON: SKIP 8XDJ Comment in plain multiline value Error Test
YAML Input
key: word1
#  xxx
  word2
Event Tree Output
Yamlrw error: expected mapping key at lines 3-4
PASS JSON: PASS 8XYN Anchor with unicode character
YAML Input
---
- &😁 unicode anchor
Event Tree Output
+STR
+DOC ---
+SEQ
=VAL &😁 :unicode anchor
-SEQ
-DOC
-STR
Expected JSON
[
  "unicode anchor"
]
Actual JSON
[
  "unicode anchor"
]
PASS JSON: PASS 93JH Block Mappings in Block Sequence
YAML Input
 - key: value
   key2: value2
 -
   key3: value3
Event Tree Output
+STR
+DOC
+SEQ
+MAP
=VAL :key
=VAL :value
=VAL :key2
=VAL :value2
-MAP
+MAP
=VAL :key3
=VAL :value3
-MAP
-SEQ
-DOC
-STR
Expected JSON
[
  {
    "key": "value",
    "key2": "value2"
  },
  {
    "key3": "value3"
  }
]
Actual JSON
[
  {
    "key": "value",
    "key2": "value2"
  },
  {
    "key3": "value3"
  }
]
PASS JSON: PASS 93WF Spec Example 6.6. Line Folding [1.3]
YAML Input
--- >-
  trimmed
  
 

  as
  space
Event Tree Output
+STR
+DOC ---
=VAL >trimmed\n\n\nas space
-DOC
-STR
Expected JSON
"trimmed\n\n\nas space"
Actual JSON
"trimmed\n\n\nas space"
PASS JSON: PASS 96L6 Spec Example 2.14. In the folded scalars, newlines become spaces
YAML Input
--- >
  Mark McGwire's
  year was crippled
  by a knee injury.
Event Tree Output
+STR
+DOC ---
=VAL >Mark McGwire's year was crippled by a knee injury.\n
-DOC
-STR
Expected JSON
"Mark McGwire's year was crippled by a knee injury.\n"
Actual JSON
"Mark McGwire's year was crippled by a knee injury.\n"
PASS JSON: PASS 96NN:00 Leading tab content in literals
YAML Input
foo: |-
 	bar
Event Tree Output
+STR
+DOC
+MAP
=VAL :foo
=VAL |\tbar
-MAP
-DOC
-STR
Expected JSON
{"foo":"\tbar"}
Actual JSON
{
  "foo": "\tbar"
}
PASS JSON: PASS 96NN:01 Leading tab content in literals
YAML Input
foo: |-
 	bar
Event Tree Output
+STR
+DOC
+MAP
=VAL :foo
=VAL |\tbar
-MAP
-DOC
-STR
Expected JSON
{"foo":"\tbar"}
Actual JSON
{
  "foo": "\tbar"
}
PASS JSON: PASS 98YD Spec Example 5.5. Comment Indicator
YAML Input
# Comment only.
Event Tree Output
+STR
-STR
PASS JSON: PASS 9BXH Multiline doublequoted flow mapping key without value
YAML Input
---
- { "single line", a: b}
- { "multi
  line", a: b}
Event Tree Output
+STR
+DOC ---
+SEQ
+MAP {}
=VAL "single line
=VAL :
=VAL :a
=VAL :b
-MAP
+MAP {}
=VAL "multi line
=VAL :
=VAL :a
=VAL :b
-MAP
-SEQ
-DOC
-STR
Expected JSON
[
  {
    "single line": null,
    "a": "b"
  },
  {
    "multi line": null,
    "a": "b"
  }
]
Actual JSON
[
  {
    "single line": null,
    "a": "b"
  },
  {
    "multi line": null,
    "a": "b"
  }
]
PASS JSON: SKIP 9C9N Wrong indented flow sequence Error Test
YAML Input
---
flow: [a,
b,
c]
Event Tree Output
Yamlrw error: invalid indentation in flow construct at line 3, columns 1-1
PASS JSON: SKIP 9CWY Invalid scalar at the end of mapping Error Test
YAML Input
key:
 - item1
 - item2
invalid
Event Tree Output
Yamlrw error: expected mapping key at line 4, columns 1-1
PASS JSON: PASS 9DXL Spec Example 9.6. Stream [1.3]
YAML Input
Mapping: Document
---
# Empty
...
%YAML 1.2
---
matches %: 20
Event Tree Output
+STR
+DOC
+MAP
=VAL :Mapping
=VAL :Document
-MAP
-DOC
+DOC ---
=VAL :
-DOC ...
+DOC ---
+MAP
=VAL :matches %
=VAL :20
-MAP
-DOC
-STR
Expected JSON
{
  "Mapping": "Document"
}
null
{
  "matches %": 20
}
Actual JSON
{
  "Mapping": "Document"
}
null
{
  "matches %": 20
}
PASS JSON: PASS 9FMG Multi-level Mapping Indent
YAML Input
a:
  b:
    c: d
  e:
    f: g
h: i
Event Tree Output
+STR
+DOC
+MAP
=VAL :a
+MAP
=VAL :b
+MAP
=VAL :c
=VAL :d
-MAP
=VAL :e
+MAP
=VAL :f
=VAL :g
-MAP
-MAP
=VAL :h
=VAL :i
-MAP
-DOC
-STR
Expected JSON
{
  "a": {
    "b": {
      "c": "d"
    },
    "e": {
      "f": "g"
    }
  },
  "h": "i"
}
Actual JSON
{
  "a": {
    "b": {
      "c": "d"
    },
    "e": {
      "f": "g"
    }
  },
  "h": "i"
}
PASS JSON: SKIP 9HCY Need document footer before directives Error Test
YAML Input
!foo "bar"
%TAG ! tag:example.com,2000:app/
---
!foo "bar"
Event Tree Output
Yamlrw error: unexpected token: directives must be separated from document content by document end marker (...) at line 2, columns 1-1
PASS JSON: PASS 9J7A Simple Mapping Indent
YAML Input
foo:
  bar: baz
Event Tree Output
+STR
+DOC
+MAP
=VAL :foo
+MAP
=VAL :bar
=VAL :baz
-MAP
-MAP
-DOC
-STR
Expected JSON
{
  "foo": {
    "bar": "baz"
  }
}
Actual JSON
{
  "foo": {
    "bar": "baz"
  }
}
PASS JSON: SKIP 9JBA Invalid comment after end of flow sequence Error Test
YAML Input
---
[ a, b, c, ]#invalid
Event Tree Output
Yamlrw error: comments must be separated from other tokens by whitespace at line 2, columns 13-13
PASS JSON: PASS 9KAX Various combinations of tags and anchors
YAML Input
---
&a1
!!str
scalar1
---
!!str
&a2
scalar2
---
&a3
!!str scalar3
---
&a4 !!map
&a5 !!str key5: value4
---
a6: 1
&anchor6 b6: 2
---
!!map
&a8 !!str key8: value7
---
!!map
!!str &a10 key10: value9
---
!!str &a11
value11
Event Tree Output
+STR
+DOC ---
=VAL &a1 <tag:yaml.org,2002:str> :scalar1
-DOC
+DOC ---
=VAL &a2 <tag:yaml.org,2002:str> :scalar2
-DOC
+DOC ---
=VAL &a3 <tag:yaml.org,2002:str> :scalar3
-DOC
+DOC ---
+MAP &a4 <tag:yaml.org,2002:map>
=VAL &a5 <tag:yaml.org,2002:str> :key5
=VAL :value4
-MAP
-DOC
+DOC ---
+MAP
=VAL :a6
=VAL :1
=VAL &anchor6 :b6
=VAL :2
-MAP
-DOC
+DOC ---
+MAP <tag:yaml.org,2002:map>
=VAL &a8 <tag:yaml.org,2002:str> :key8
=VAL :value7
-MAP
-DOC
+DOC ---
+MAP <tag:yaml.org,2002:map>
=VAL &a10 <tag:yaml.org,2002:str> :key10
=VAL :value9
-MAP
-DOC
+DOC ---
=VAL &a11 <tag:yaml.org,2002:str> :value11
-DOC
-STR
Expected JSON
"scalar1"
"scalar2"
"scalar3"
{
  "key5": "value4"
}
{
  "a6": 1,
  "b6": 2
}
{
  "key8": "value7"
}
{
  "key10": "value9"
}
"value11"
Actual JSON
"scalar1"
"scalar2"
"scalar3"
{
  "key5": "value4"
}
{
  "a6": 1,
  "b6": 2
}
{
  "key8": "value7"
}
{
  "key10": "value9"
}
"value11"
PASS JSON: SKIP 9KBC Mapping starting at --- line Error Test
YAML Input
--- key1: value1
    key2: value2
Event Tree Output
Yamlrw error: expected mapping key at line 1, columns 9-9
PASS JSON: SKIP 9MAG Flow sequence with invalid comma at the beginning Error Test
YAML Input
---
[ , a, b, c ]
Event Tree Output
Yamlrw error: unexpected token: unexpected ',' in flow sequence at line 2, columns 3-4
PASS JSON: SKIP 9MMA Directive by itself with no document Error Test
YAML Input
%YAML 1.2
Event Tree Output
Yamlrw error: expected document start '---' at line 2, columns 1-1
PASS JSON: SKIP 9MMW Single Pair Implicit Entries
YAML Input
- [ YAML : separate ]
- [ "JSON like":adjacent ]
- [ {JSON: like}:adjacent ]
Event Tree Output
+STR
+DOC
+SEQ
+SEQ []
+MAP {}
=VAL :YAML
=VAL :separate
-MAP
-SEQ
+SEQ []
+MAP {}
=VAL "JSON like
=VAL :adjacent
-MAP
-SEQ
+SEQ []
+MAP {}
+MAP {}
=VAL :JSON
=VAL :like
-MAP
=VAL :adjacent
-MAP
-SEQ
-SEQ
-DOC
-STR
PASS JSON: PASS 9MQT:00 Scalar doc with '...' in content
YAML Input
--- "a
...x
b"
Event Tree Output
+STR
+DOC ---
=VAL "a ...x b
-DOC
-STR
Expected JSON
"a ...x b"
Actual JSON
"a ...x b"
PASS JSON: SKIP 9MQT:01 Scalar doc with '...' in content Error Test
YAML Input
--- "a
... x
b"
Event Tree Output
Yamlrw error: unclosed double quote at line 1, columns 5-5
Expected JSON
"a ...x b"
Actual JSON

          
PASS JSON: PASS 9SA2 Multiline double quoted flow mapping key
YAML Input
---
- { "single line": value}
- { "multi
  line": value}
Event Tree Output
+STR
+DOC ---
+SEQ
+MAP {}
=VAL "single line
=VAL :value
-MAP
+MAP {}
=VAL "multi line
=VAL :value
-MAP
-SEQ
-DOC
-STR
Expected JSON
[
  {
    "single line": "value"
  },
  {
    "multi line": "value"
  }
]
Actual JSON
[
  {
    "single line": "value"
  },
  {
    "multi line": "value"
  }
]
PASS JSON: PASS 9SHH Spec Example 5.8. Quoted Scalar Indicators
YAML Input
single: 'text'
double: "text"
Event Tree Output
+STR
+DOC
+MAP
=VAL :single
=VAL 'text
=VAL :double
=VAL "text
-MAP
-DOC
-STR
Expected JSON
{
  "single": "text",
  "double": "text"
}
Actual JSON
{
  "single": "text",
  "double": "text"
}
PASS JSON: PASS 9TFX Spec Example 7.6. Double Quoted Lines [1.3]
YAML Input
---
" 1st non-empty

 2nd non-empty 
 3rd non-empty "
Event Tree Output
+STR
+DOC ---
=VAL " 1st non-empty\n2nd non-empty 3rd non-empty 
-DOC
-STR
Expected JSON
" 1st non-empty\n2nd non-empty 3rd non-empty "
Actual JSON
" 1st non-empty\n2nd non-empty 3rd non-empty "
PASS JSON: PASS 9U5K Spec Example 2.12. Compact Nested Mapping
YAML Input
---
# Products purchased
- item    : Super Hoop
  quantity: 1
- item    : Basketball
  quantity: 4
- item    : Big Shoes
  quantity: 1
Event Tree Output
+STR
+DOC ---
+SEQ
+MAP
=VAL :item
=VAL :Super Hoop
=VAL :quantity
=VAL :1
-MAP
+MAP
=VAL :item
=VAL :Basketball
=VAL :quantity
=VAL :4
-MAP
+MAP
=VAL :item
=VAL :Big Shoes
=VAL :quantity
=VAL :1
-MAP
-SEQ
-DOC
-STR
Expected JSON
[
  {
    "item": "Super Hoop",
    "quantity": 1
  },
  {
    "item": "Basketball",
    "quantity": 4
  },
  {
    "item": "Big Shoes",
    "quantity": 1
  }
]
Actual JSON
[
  {
    "item": "Super Hoop",
    "quantity": 1
  },
  {
    "item": "Basketball",
    "quantity": 4
  },
  {
    "item": "Big Shoes",
    "quantity": 1
  }
]
PASS JSON: PASS 9WXW Spec Example 6.18. Primary Tag Handle
YAML Input
# Private
!foo "bar"
...
# Global
%TAG ! tag:example.com,2000:app/
---
!foo "bar"
Event Tree Output
+STR
+DOC
=VAL <!foo> "bar
-DOC ...
+DOC ---
=VAL <tag:example.com,2000:app/foo> "bar
-DOC
-STR
Expected JSON
"bar"
"bar"
Actual JSON
"bar"
"bar"
PASS JSON: PASS 9YRD Multiline Scalar at Top Level
YAML Input
a
b  
  c
d

e
Event Tree Output
+STR
+DOC
=VAL :a b c d\ne
-DOC
-STR
Expected JSON
"a b c d\ne"
Actual JSON
"a b c d\ne"
PASS JSON: PASS A2M4 Spec Example 6.2. Indentation Indicators
YAML Input
? a
: -	b
  -  -	c
     - d
Event Tree Output
+STR
+DOC
+MAP
=VAL :a
+SEQ
=VAL :b
+SEQ
=VAL :c
=VAL :d
-SEQ
-SEQ
-MAP
-DOC
-STR
Expected JSON
{
  "a": [
    "b",
    [
      "c",
      "d"
    ]
  ]
}
Actual JSON
{
  "a": [
    "b",
    [
      "c",
      "d"
    ]
  ]
}
PASS JSON: PASS A6F9 Spec Example 8.4. Chomping Final Line Break
YAML Input
strip: |-
  text
clip: |
  text
keep: |+
  text
Event Tree Output
+STR
+DOC
+MAP
=VAL :strip
=VAL |text
=VAL :clip
=VAL |text\n
=VAL :keep
=VAL |text\n
-MAP
-DOC
-STR
Expected JSON
{
  "strip": "text",
  "clip": "text\n",
  "keep": "text\n"
}
Actual JSON
{
  "strip": "text",
  "clip": "text\n",
  "keep": "text\n"
}
PASS JSON: PASS A984 Multiline Scalar in Mapping
YAML Input
a: b
 c
d:
 e
  f
Event Tree Output
+STR
+DOC
+MAP
=VAL :a
=VAL :b c
=VAL :d
=VAL :e f
-MAP
-DOC
-STR
Expected JSON
{
  "a": "b c",
  "d": "e f"
}
Actual JSON
{
  "a": "b c",
  "d": "e f"
}
PASS JSON: PASS AB8U Sequence entry that looks like two with wrong indentation
YAML Input
- single multiline
 - sequence entry
Event Tree Output
+STR
+DOC
+SEQ
=VAL :single multiline - sequence entry
-SEQ
-DOC
-STR
Expected JSON
[
  "single multiline - sequence entry"
]
Actual JSON
[
  "single multiline - sequence entry"
]
PASS JSON: PASS AVM7 Empty Stream
YAML Input

          
Event Tree Output
+STR
-STR
PASS JSON: PASS AZ63 Sequence With Same Indentation as Parent Mapping
YAML Input
one:
- 2
- 3
four: 5
Event Tree Output
+STR
+DOC
+MAP
=VAL :one
+SEQ
=VAL :2
=VAL :3
-SEQ
=VAL :four
=VAL :5
-MAP
-DOC
-STR
Expected JSON
{
  "one": [
    2,
    3
  ],
  "four": 5
}
Actual JSON
{
  "one": [
    2,
    3
  ],
  "four": 5
}
PASS JSON: PASS AZW3 Lookahead test cases
YAML Input
- bla"keks: foo
- bla]keks: foo
Event Tree Output
+STR
+DOC
+SEQ
+MAP
=VAL :bla"keks
=VAL :foo
-MAP
+MAP
=VAL :bla]keks
=VAL :foo
-MAP
-SEQ
-DOC
-STR
Expected JSON
[
  {
    "bla\"keks": "foo"
  },
  {
    "bla]keks": "foo"
  }
]
Actual JSON
[
  {
    "bla\"keks": "foo"
  },
  {
    "bla]keks": "foo"
  }
]
PASS JSON: PASS B3HG Spec Example 8.9. Folded Scalar [1.3]
YAML Input
--- >
 folded
 text


Event Tree Output
+STR
+DOC ---
=VAL >folded text\n
-DOC
-STR
Expected JSON
"folded text\n"
Actual JSON
"folded text\n"
PASS JSON: SKIP B63P Directive without document Error Test
YAML Input
%YAML 1.2
...
Event Tree Output
Yamlrw error: expected document start '---' at line 2, columns 1-4
PASS JSON: SKIP BD7L Invalid mapping after sequence Error Test
YAML Input
- item1
- item2
invalid: x
Event Tree Output
Yamlrw error: expected block entry '-' at line 3, columns 1-1
PASS JSON: PASS BEC7 Spec Example 6.14. “YAML” directive
YAML Input
%YAML 1.3 # Attempt parsing
          # with a warning
---
"foo"
Event Tree Output
+STR
+DOC ---
=VAL "foo
-DOC
-STR
Expected JSON
"foo"
Actual JSON
"foo"
PASS JSON: SKIP BF9H Trailing comment in multiline plain scalar Error Test
YAML Input
---
plain: a
       b # end of scalar
       c
Event Tree Output
Yamlrw error: expected mapping key at lines 4-5
PASS JSON: SKIP BS4K Comment between plain scalar lines Error Test
YAML Input
word1  # comment
word2
Event Tree Output
Yamlrw error: unexpected token: content not allowed after document value at lines 2-3
PASS JSON: PASS BU8L Node Anchor and Tag on Seperate Lines
YAML Input
key: &anchor
 !!map
  a: b
Event Tree Output
+STR
+DOC
+MAP
=VAL :key
+MAP &anchor <tag:yaml.org,2002:map>
=VAL :a
=VAL :b
-MAP
-MAP
-DOC
-STR
Expected JSON
{
  "key": {
    "a": "b"
  }
}
Actual JSON
{
  "key": {
    "a": "b"
  }
}
PASS JSON: PASS C2DT Spec Example 7.18. Flow Mapping Adjacent Values
YAML Input
{
"adjacent":value,
"readable": value,
"empty":
}
Event Tree Output
+STR
+DOC
+MAP {}
=VAL "adjacent
=VAL :value
=VAL "readable
=VAL :value
=VAL "empty
=VAL :
-MAP
-DOC
-STR
Expected JSON
{
  "adjacent": "value",
  "readable": "value",
  "empty": null
}
Actual JSON
{
  "adjacent": "value",
  "readable": "value",
  "empty": null
}
PASS JSON: SKIP C2SP Flow Mapping Key on two lines Error Test
YAML Input
[23
]: 42
Event Tree Output
Yamlrw error: expected mapping key at line 2, columns 2-2
PASS JSON: PASS C4HZ Spec Example 2.24. Global Tags
YAML Input
%TAG ! tag:clarkevans.com,2002:
--- !shape
  # Use the ! handle for presenting
  # tag:clarkevans.com,2002:circle
- !circle
  center: &ORIGIN {x: 73, y: 129}
  radius: 7
- !line
  start: *ORIGIN
  finish: { x: 89, y: 102 }
- !label
  start: *ORIGIN
  color: 0xFFEEBB
  text: Pretty vector drawing.
Event Tree Output
+STR
+DOC ---
+SEQ <tag:clarkevans.com,2002:shape>
+MAP <tag:clarkevans.com,2002:circle>
=VAL :center
+MAP {} &ORIGIN
=VAL :x
=VAL :73
=VAL :y
=VAL :129
-MAP
=VAL :radius
=VAL :7
-MAP
+MAP <tag:clarkevans.com,2002:line>
=VAL :start
=ALI *ORIGIN
=VAL :finish
+MAP {}
=VAL :x
=VAL :89
=VAL :y
=VAL :102
-MAP
-MAP
+MAP <tag:clarkevans.com,2002:label>
=VAL :start
=ALI *ORIGIN
=VAL :color
=VAL :0xFFEEBB
=VAL :text
=VAL :Pretty vector drawing.
-MAP
-SEQ
-DOC
-STR
Expected JSON
[
  {
    "center": {
      "x": 73,
      "y": 129
    },
    "radius": 7
  },
  {
    "start": {
      "x": 73,
      "y": 129
    },
    "finish": {
      "x": 89,
      "y": 102
    }
  },
  {
    "start": {
      "x": 73,
      "y": 129
    },
    "color": 16772795,
    "text": "Pretty vector drawing."
  }
]
Actual JSON
[
  {
    "center": {
      "x": 73,
      "y": 129
    },
    "radius": 7
  },
  {
    "start": {
      "x": 73,
      "y": 129
    },
    "finish": {
      "x": 89,
      "y": 102
    }
  },
  {
    "start": {
      "x": 73,
      "y": 129
    },
    "color": 16772795,
    "text": "Pretty vector drawing."
  }
]
PASS JSON: PASS CC74 Spec Example 6.20. Tag Handles
YAML Input
%TAG !e! tag:example.com,2000:app/
---
!e!foo "bar"
Event Tree Output
+STR
+DOC ---
=VAL <tag:example.com,2000:app/foo> "bar
-DOC
-STR
Expected JSON
"bar"
Actual JSON
"bar"
PASS JSON: SKIP CFD4 Empty implicit key in single pair flow sequences
YAML Input
- [ : empty key ]
- [: another empty key]
Event Tree Output
+STR
+DOC
+SEQ
+SEQ []
+MAP {}
=VAL :
=VAL :empty key
-MAP
-SEQ
+SEQ []
+MAP {}
=VAL :
=VAL :another empty key
-MAP
-SEQ
-SEQ
-DOC
-STR
PASS JSON: SKIP CML9 Missing comma in flow Error Test
YAML Input
key: [ word1
#  xxx
  word2 ]
Event Tree Output
Yamlrw error: expected sequence end ']' at line 3, columns 3-9
PASS JSON: PASS CN3R Various location of anchors in flow sequence
YAML Input
&flowseq [
 a: b,
 &c c: d,
 { &e e: f },
 &g { g: h }
]
Event Tree Output
+STR
+DOC
+SEQ [] &flowseq
+MAP {}
=VAL :a
=VAL :b
-MAP
+MAP {}
=VAL &c :c
=VAL :d
-MAP
+MAP {}
=VAL &e :e
=VAL :f
-MAP
+MAP {} &g
=VAL :g
=VAL :h
-MAP
-SEQ
-DOC
-STR
Expected JSON
[
  {
    "a": "b"
  },
  {
    "c": "d"
  },
  {
    "e": "f"
  },
  {
    "g": "h"
  }
]
Actual JSON
[
  {
    "a": "b"
  },
  {
    "c": "d"
  },
  {
    "e": "f"
  },
  {
    "g": "h"
  }
]
PASS JSON: PASS CPZ3 Doublequoted scalar starting with a tab
YAML Input
---
tab: "\tstring"
Event Tree Output
+STR
+DOC ---
+MAP
=VAL :tab
=VAL "\tstring
-MAP
-DOC
-STR
Expected JSON
{
  "tab": "\tstring"
}
Actual JSON
{
  "tab": "\tstring"
}
PASS JSON: SKIP CQ3W Double quoted string without closing quote Error Test
YAML Input
---
key: "missing closing quote
Event Tree Output
Yamlrw error: unclosed double quote at line 2, columns 6-6
PASS JSON: PASS CT4Q Spec Example 7.20. Single Pair Explicit Entry
YAML Input
[
? foo
 bar : baz
]
Event Tree Output
+STR
+DOC
+SEQ []
+MAP {}
=VAL :foo bar
=VAL :baz
-MAP
-SEQ
-DOC
-STR
Expected JSON
[
  {
    "foo bar": "baz"
  }
]
Actual JSON
[
  {
    "foo bar": "baz"
  }
]
PASS JSON: SKIP CTN5 Flow sequence with invalid extra comma Error Test
YAML Input
---
[ a, b, c, , ]
Event Tree Output
Yamlrw error: unexpected token: unexpected ',' in flow sequence at line 2, columns 12-13
PASS JSON: PASS CUP7 Spec Example 5.6. Node Property Indicators
YAML Input
anchored: !local &anchor value
alias: *anchor
Event Tree Output
+STR
+DOC
+MAP
=VAL :anchored
=VAL &anchor <!local> :value
=VAL :alias
=ALI *anchor
-MAP
-DOC
-STR
Expected JSON
{
  "anchored": "value",
  "alias": "value"
}
Actual JSON
{
  "anchored": "value",
  "alias": "value"
}
PASS JSON: SKIP CVW2 Invalid comment after comma Error Test
YAML Input
---
[ a, b, c,#invalid
]
Event Tree Output
Yamlrw error: comments must be separated from other tokens by whitespace at line 2, columns 11-11
PASS JSON: SKIP CXX2 Mapping with anchor on document start line Error Test
YAML Input
--- &anchor a: b
Event Tree Output
Yamlrw error: expected mapping key at line 1, columns 14-14
PASS JSON: SKIP D49Q Multiline single quoted implicit keys Error Test
YAML Input
'a\nb': 1
'c
 d': 1
Event Tree Output
Yamlrw error: expected mapping key at line 2, columns 1-1
PASS JSON: PASS D83L Block scalar indicator order
YAML Input
- |2-
  explicit indent and chomp
- |-2
  chomp and explicit indent
Event Tree Output
+STR
+DOC
+SEQ
=VAL |explicit indent and chomp
=VAL |chomp and explicit indent
-SEQ
-DOC
-STR
Expected JSON
[
  "explicit indent and chomp",
  "chomp and explicit indent"
]
Actual JSON
[
  "explicit indent and chomp",
  "chomp and explicit indent"
]
PASS JSON: PASS D88J Flow Sequence in Block Mapping
YAML Input
a: [b, c]
Event Tree Output
+STR
+DOC
+MAP
=VAL :a
+SEQ []
=VAL :b
=VAL :c
-SEQ
-MAP
-DOC
-STR
Expected JSON
{
  "a": [
    "b",
    "c"
  ]
}
Actual JSON
{
  "a": [
    "b",
    "c"
  ]
}
PASS JSON: PASS D9TU Single Pair Block Mapping
YAML Input
foo: bar
Event Tree Output
+STR
+DOC
+MAP
=VAL :foo
=VAL :bar
-MAP
-DOC
-STR
Expected JSON
{
  "foo": "bar"
}
Actual JSON
{
  "foo": "bar"
}
PASS JSON: PASS DBG4 Spec Example 7.10. Plain Characters
YAML Input
# Outside flow collection:
- ::vector
- ": - ()"
- Up, up, and away!
- -123
- http://example.com/foo#bar
# Inside flow collection:
- [ ::vector,
  ": - ()",
  "Up, up and away!",
  -123,
  http://example.com/foo#bar ]
Event Tree Output
+STR
+DOC
+SEQ
=VAL :::vector
=VAL ": - ()
=VAL :Up, up, and away!
=VAL :-123
=VAL :http://example.com/foo#bar
+SEQ []
=VAL :::vector
=VAL ": - ()
=VAL "Up, up and away!
=VAL :-123
=VAL :http://example.com/foo#bar
-SEQ
-SEQ
-DOC
-STR
Expected JSON
[
  "::vector",
  ": - ()",
  "Up, up, and away!",
  -123,
  "http://example.com/foo#bar",
  [
    "::vector",
    ": - ()",
    "Up, up and away!",
    -123,
    "http://example.com/foo#bar"
  ]
]
Actual JSON
[
  "::vector",
  ": - ()",
  "Up, up, and away!",
  -123,
  "http://example.com/foo#bar",
  [
    "::vector",
    ": - ()",
    "Up, up and away!",
    -123,
    "http://example.com/foo#bar"
  ]
]
PASS JSON: PASS DC7X Various trailing tabs
YAML Input
a: b	
seq:	
 - a	
c: d	#X
Event Tree Output
+STR
+DOC
+MAP
=VAL :a
=VAL :b
=VAL :seq
+SEQ
=VAL :a
-SEQ
=VAL :c
=VAL :d
-MAP
-DOC
-STR
Expected JSON
{
  "a": "b",
  "seq": [
    "a"
  ],
  "c": "d"
}
Actual JSON
{
  "a": "b",
  "seq": [
    "a"
  ],
  "c": "d"
}
PASS JSON: PASS DE56:00 Trailing tabs in double quoted
YAML Input
"1 trailing\t
    tab"
Event Tree Output
+STR
+DOC
=VAL "1 trailing\t tab
-DOC
-STR
Expected JSON
"1 trailing\t tab"
Actual JSON
"1 trailing\t tab"
PASS JSON: PASS DE56:01 Trailing tabs in double quoted
YAML Input
"2 trailing\t  
    tab"
Event Tree Output
+STR
+DOC
=VAL "2 trailing\t tab
-DOC
-STR
Expected JSON
"2 trailing\t tab"
Actual JSON
"2 trailing\t tab"
PASS JSON: PASS DE56:02 Trailing tabs in double quoted
YAML Input
"3 trailing\	
    tab"
Event Tree Output
+STR
+DOC
=VAL "3 trailing\t tab
-DOC
-STR
Expected JSON
"3 trailing\t tab"
Actual JSON
"3 trailing\t tab"
PASS JSON: PASS DE56:03 Trailing tabs in double quoted
YAML Input
"4 trailing\	  
    tab"
Event Tree Output
+STR
+DOC
=VAL "4 trailing\t tab
-DOC
-STR
Expected JSON
"4 trailing\t tab"
Actual JSON
"4 trailing\t tab"
PASS JSON: PASS DE56:04 Trailing tabs in double quoted
YAML Input
"5 trailing	
    tab"
Event Tree Output
+STR
+DOC
=VAL "5 trailing tab
-DOC
-STR
Expected JSON
"5 trailing tab"
Actual JSON
"5 trailing tab"
PASS JSON: PASS DE56:05 Trailing tabs in double quoted
YAML Input
"6 trailing	  
    tab"
Event Tree Output
+STR
+DOC
=VAL "6 trailing tab
-DOC
-STR
Expected JSON
"6 trailing tab"
Actual JSON
"6 trailing tab"
PASS JSON: SKIP DFF7 Spec Example 7.16. Flow Mapping Entries
YAML Input
{
? explicit: entry,
implicit: entry,
?
}
Event Tree Output
+STR
+DOC
+MAP {}
=VAL :explicit
=VAL :entry
=VAL :implicit
=VAL :entry
=VAL :
=VAL :
-MAP
-DOC
-STR
PASS JSON: PASS DHP8 Flow Sequence
YAML Input
[foo, bar, 42]
Event Tree Output
+STR
+DOC
+SEQ []
=VAL :foo
=VAL :bar
=VAL :42
-SEQ
-DOC
-STR
Expected JSON
[
  "foo",
  "bar",
  42
]
Actual JSON
[
  "foo",
  "bar",
  42
]
PASS JSON: PASS DK3J Zero indented block scalar with line that looks like a comment
YAML Input
--- >
line1
# no comment
line3
Event Tree Output
+STR
+DOC ---
=VAL >line1 # no comment line3\n
-DOC
-STR
Expected JSON
"line1 # no comment line3\n"
Actual JSON
"line1 # no comment line3\n"
PASS JSON: SKIP DK4H Implicit key followed by newline Error Test
YAML Input
---
[ key
  : value ]
Event Tree Output
Yamlrw error: key and ':' must be on the same line in flow context at line 3, columns 3-3
PASS JSON: PASS DK95:00 Tabs that look like indentation
YAML Input
foo:
 	bar
Event Tree Output
+STR
+DOC
+MAP
=VAL :foo
=VAL :bar
-MAP
-DOC
-STR
Expected JSON
{
  "foo" : "bar"
}
Actual JSON
{
  "foo": "bar"
}
PASS JSON: SKIP DK95:01 Tabs that look like indentation Error Test
YAML Input
foo: "bar
	baz"
Event Tree Output
Yamlrw error: invalid indentation in quoted scalar at line 2, columns 2-2
Expected JSON
{
  "foo" : "bar"
}
Actual JSON

          
PASS JSON: PASS DK95:02 Tabs that look like indentation
YAML Input
foo: "bar
  	baz"
Event Tree Output
+STR
+DOC
+MAP
=VAL :foo
=VAL "bar baz
-MAP
-DOC
-STR
Expected JSON
{
  "foo" : "bar baz"
}
Actual JSON
{
  "foo": "bar baz"
}
PASS JSON: PASS DK95:03 Tabs that look like indentation
YAML Input
 	
foo: 1
Event Tree Output
+STR
+DOC
+MAP
=VAL :foo
=VAL :1
-MAP
-DOC
-STR
Expected JSON
{
  "foo" : 1
}
Actual JSON
{
  "foo": 1
}
PASS JSON: PASS DK95:04 Tabs that look like indentation
YAML Input
foo: 1
	
bar: 2
Event Tree Output
+STR
+DOC
+MAP
=VAL :foo
=VAL :1
=VAL :bar
=VAL :2
-MAP
-DOC
-STR
Expected JSON
{
  "foo" : 1,
  "bar" : 2
}
Actual JSON
{
  "foo": 1,
  "bar": 2
}
PASS JSON: PASS DK95:05 Tabs that look like indentation
YAML Input
foo: 1
 	
bar: 2
Event Tree Output
+STR
+DOC
+MAP
=VAL :foo
=VAL :1
=VAL :bar
=VAL :2
-MAP
-DOC
-STR
Expected JSON
{
  "foo" : 1,
  "bar" : 2
}
Actual JSON
{
  "foo": 1,
  "bar": 2
}
PASS JSON: SKIP DK95:06 Tabs that look like indentation Error Test
YAML Input
foo:
  a: 1
  	b: 2
Event Tree Output
Yamlrw error: expected mapping key at line 3, columns 5-5
Expected JSON
{
  "foo" : 1,
  "bar" : 2
}
Actual JSON

          
PASS JSON: PASS DK95:07 Tabs that look like indentation
YAML Input
%YAML 1.2
	
---
Event Tree Output
+STR
+DOC ---
=VAL :
-DOC
-STR
Expected JSON
null
Actual JSON
null
PASS JSON: PASS DK95:08 Tabs that look like indentation
YAML Input
foo: "bar
 	 	 baz 	 	 "
Event Tree Output
+STR
+DOC
+MAP
=VAL :foo
=VAL "bar baz \t \t 
-MAP
-DOC
-STR
Expected JSON
{
  "foo" : "bar baz \t \t "
}
Actual JSON
{
  "foo": "bar baz \t \t "
}
PASS JSON: SKIP DMG6 Wrong indendation in Map Error Test
YAML Input
key:
  ok: 1
 wrong: 2
Event Tree Output
Yamlrw error: expected mapping key at line 3, columns 2-2
PASS JSON: PASS DWX9 Spec Example 8.8. Literal Content
YAML Input
|
 
  
  literal
   
  
  text

 # Comment
Event Tree Output
+STR
+DOC
=VAL |\n\nliteral\n \n\ntext\n
-DOC
-STR
Expected JSON
"\n\nliteral\n \n\ntext\n"
Actual JSON
"\n\nliteral\n \n\ntext\n"
PASS JSON: PASS E76Z Aliases in Implicit Block Mapping
YAML Input
&a a: &b b
*b : *a
Event Tree Output
+STR
+DOC
+MAP
=VAL &a :a
=VAL &b :b
=ALI *b
=ALI *a
-MAP
-DOC
-STR
Expected JSON
{
  "a": "b",
  "b": "a"
}
Actual JSON
{
  "a": "b",
  "b": "a"
}
PASS JSON: SKIP EB22 Missing document-end marker before directive Error Test
YAML Input
---
scalar1 # comment
%YAML 1.2
---
scalar2
Event Tree Output
Yamlrw error: unexpected token: directives must be separated from document content by document end marker (...) at line 3, columns 1-1
PASS JSON: PASS EHF6 Tags for Flow Objects
YAML Input
!!map {
  k: !!seq
  [ a, !!str b]
}
Event Tree Output
+STR
+DOC
+MAP {} <tag:yaml.org,2002:map>
=VAL :k
+SEQ [] <tag:yaml.org,2002:seq>
=VAL :a
=VAL <tag:yaml.org,2002:str> :b
-SEQ
-MAP
-DOC
-STR
Expected JSON
{
  "k": [
    "a",
    "b"
  ]
}
Actual JSON
{
  "k": [
    "a",
    "b"
  ]
}
PASS JSON: SKIP EW3V Wrong indendation in mapping Error Test
YAML Input
k1: v1
 k2: v2
Event Tree Output
Yamlrw error: expected mapping key at line 2, columns 4-4
PASS JSON: PASS EX5H Multiline Scalar at Top Level [1.3]
YAML Input
---
a
b  
  c
d

e
Event Tree Output
+STR
+DOC ---
=VAL :a b c d\ne
-DOC
-STR
Expected JSON
"a b c d\ne"
Actual JSON
"a b c d\ne"
PASS JSON: PASS EXG3 Three dashes and content without space [1.3]
YAML Input
---
---word1
word2
Event Tree Output
+STR
+DOC ---
=VAL :---word1 word2
-DOC
-STR
Expected JSON
"---word1 word2"
Actual JSON
"---word1 word2"
PASS JSON: PASS F2C7 Anchors and Tags
YAML Input
 - &a !!str a
 - !!int 2
 - !!int &c 4
 - &d d
Event Tree Output
+STR
+DOC
+SEQ
=VAL &a <tag:yaml.org,2002:str> :a
=VAL <tag:yaml.org,2002:int> :2
=VAL &c <tag:yaml.org,2002:int> :4
=VAL &d :d
-SEQ
-DOC
-STR
Expected JSON
[
  "a",
  2,
  4,
  "d"
]
Actual JSON
[
  "a",
  2,
  4,
  "d"
]
PASS JSON: PASS F3CP Nested flow collections on one line
YAML Input
---
{ a: [b, c, { d: [e, f] } ] }
Event Tree Output
+STR
+DOC ---
+MAP {}
=VAL :a
+SEQ []
=VAL :b
=VAL :c
+MAP {}
=VAL :d
+SEQ []
=VAL :e
=VAL :f
-SEQ
-MAP
-SEQ
-MAP
-DOC
-STR
Expected JSON
{
  "a": [
    "b",
    "c",
    {
      "d": [
        "e",
        "f"
      ]
    }
  ]
}
Actual JSON
{
  "a": [
    "b",
    "c",
    {
      "d": [
        "e",
        "f"
      ]
    }
  ]
}
PASS JSON: PASS F6MC More indented lines at the beginning of folded block scalars
YAML Input
---
a: >2
   more indented
  regular
b: >2


   more indented
  regular
Event Tree Output
+STR
+DOC ---
+MAP
=VAL :a
=VAL > more indented\nregular\n
=VAL :b
=VAL >\n\n more indented\nregular\n
-MAP
-DOC
-STR
Expected JSON
{
  "a": " more indented\nregular\n",
  "b": "\n\n more indented\nregular\n"
}
Actual JSON
{
  "a": " more indented\nregular\n",
  "b": "\n\n more indented\nregular\n"
}
PASS JSON: PASS F8F9 Spec Example 8.5. Chomping Trailing Lines
YAML Input
 # Strip
  # Comments:
strip: |-
  # text
  
 # Clip
  # comments:

clip: |
  # text
 
 # Keep
  # comments:

keep: |+
  # text

 # Trail
  # comments.
Event Tree Output
+STR
+DOC
+MAP
=VAL :strip
=VAL |# text
=VAL :clip
=VAL |# text\n
=VAL :keep
=VAL |# text\n\n
-MAP
-DOC
-STR
Expected JSON
{
  "strip": "# text",
  "clip": "# text\n",
  "keep": "# text\n\n"
}
Actual JSON
{
  "strip": "# text",
  "clip": "# text\n",
  "keep": "# text\n\n"
}
PASS JSON: PASS FBC9 Allowed characters in plain scalars
YAML Input
safe: a!"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~
     !"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~
safe question mark: ?foo
safe colon: :foo
safe dash: -foo
Event Tree Output
+STR
+DOC
+MAP
=VAL :safe
=VAL :a!"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~ !"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~
=VAL :safe question mark
=VAL :?foo
=VAL :safe colon
=VAL ::foo
=VAL :safe dash
=VAL :-foo
-MAP
-DOC
-STR
Expected JSON
{
  "safe": "a!\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~ !\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~",
  "safe question mark": "?foo",
  "safe colon": ":foo",
  "safe dash": "-foo"
}
Actual JSON
{
  "safe": "a!\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~ !\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~",
  "safe question mark": "?foo",
  "safe colon": ":foo",
  "safe dash": "-foo"
}
PASS JSON: SKIP FH7J Tags on Empty Scalars
YAML Input
- !!str
-
  !!null : a
  b: !!str
- !!str : !!null
Event Tree Output
+STR
+DOC
+SEQ
=VAL <tag:yaml.org,2002:str> :
+MAP
=VAL <tag:yaml.org,2002:null> :
=VAL :a
=VAL :b
=VAL <tag:yaml.org,2002:str> :
-MAP
+MAP
=VAL <tag:yaml.org,2002:str> :
=VAL <tag:yaml.org,2002:null> :
-MAP
-SEQ
-DOC
-STR
PASS JSON: PASS FP8R Zero indented block scalar
YAML Input
--- >
line1
line2
line3
Event Tree Output
+STR
+DOC ---
=VAL >line1 line2 line3\n
-DOC
-STR
Expected JSON
"line1 line2 line3\n"
Actual JSON
"line1 line2 line3\n"
PASS JSON: PASS FQ7F Spec Example 2.1. Sequence of Scalars
YAML Input
- Mark McGwire
- Sammy Sosa
- Ken Griffey
Event Tree Output
+STR
+DOC
+SEQ
=VAL :Mark McGwire
=VAL :Sammy Sosa
=VAL :Ken Griffey
-SEQ
-DOC
-STR
Expected JSON
[
  "Mark McGwire",
  "Sammy Sosa",
  "Ken Griffey"
]
Actual JSON
[
  "Mark McGwire",
  "Sammy Sosa",
  "Ken Griffey"
]
PASS JSON: SKIP FRK4 Spec Example 7.3. Completely Empty Flow Nodes
YAML Input
{
  ? foo :,
  : bar,
}
Event Tree Output
+STR
+DOC
+MAP {}
=VAL :foo
=VAL :
=VAL :
=VAL :bar
-MAP
-DOC
-STR
PASS JSON: PASS FTA2 Single block sequence with anchor and explicit document start
YAML Input
--- &sequence
- a
Event Tree Output
+STR
+DOC ---
+SEQ &sequence
=VAL :a
-SEQ
-DOC
-STR
Expected JSON
[
  "a"
]
Actual JSON
[
  "a"
]
PASS JSON: PASS FUP4 Flow Sequence in Flow Sequence
YAML Input
[a, [b, c]]
Event Tree Output
+STR
+DOC
+SEQ []
=VAL :a
+SEQ []
=VAL :b
=VAL :c
-SEQ
-SEQ
-DOC
-STR
Expected JSON
[
  "a",
  [
    "b",
    "c"
  ]
]
Actual JSON
[
  "a",
  [
    "b",
    "c"
  ]
]
PASS JSON: PASS G4RS Spec Example 2.17. Quoted Scalars
YAML Input
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: '|\-*-/|'
Event Tree Output
+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": "|\\-*-/|"
}
Actual 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": "|\\-*-/|"
}
PASS JSON: SKIP G5U8 Plain dashes in flow sequence Error Test
YAML Input
---
- [-, -]
Event Tree Output
Yamlrw error: unexpected character '-' at line 2, columns 4-4
PASS JSON: SKIP G7JE Multiline implicit keys Error Test
YAML Input
a\nb: 1
c
 d: 1
Event Tree Output
Yamlrw error: expected mapping key at line 2, columns 1-1
PASS JSON: PASS G992 Spec Example 8.9. Folded Scalar
YAML Input
>
 folded
 text


Event Tree Output
+STR
+DOC
=VAL >folded text\n
-DOC
-STR
Expected JSON
"folded text\n"
Actual JSON
"folded text\n"
PASS JSON: SKIP G9HC Invalid anchor in zero indented sequence Error Test
YAML Input
---
seq:
&anchor
- a
- b
Event Tree Output
Yamlrw error: expected mapping key at line 3, columns 1-1
PASS JSON: SKIP GDY7 Comment that looks like a mapping key Error Test
YAML Input
key: value
this is #not a: key
Event Tree Output
Yamlrw error: expected mapping key at line 2, columns 1-1
PASS JSON: PASS GH63 Mixed Block Mapping (explicit to implicit)
YAML Input
? a
: 1.3
fifteen: d
Event Tree Output
+STR
+DOC
+MAP
=VAL :a
=VAL :1.3
=VAL :fifteen
=VAL :d
-MAP
-DOC
-STR
Expected JSON
{
  "a": 1.3,
  "fifteen": "d"
}
Actual JSON
{
  "a": 1.3,
  "fifteen": "d"
}
PASS JSON: SKIP GT5M Node anchor in sequence Error Test
YAML Input
- item1
&node
- item2
Event Tree Output
Yamlrw error: expected mapping key at line 2, columns 1-1
PASS JSON: PASS H2RW Blank lines
YAML Input
foo: 1

bar: 2
    
text: |
  a
    
  b

  c
 
  d
Event Tree Output
+STR
+DOC
+MAP
=VAL :foo
=VAL :1
=VAL :bar
=VAL :2
=VAL :text
=VAL |a\n  \nb\n\nc\n\nd\n
-MAP
-DOC
-STR
Expected JSON
{
  "foo": 1,
  "bar": 2,
  "text": "a\n  \nb\n\nc\n\nd\n"
}
Actual JSON
{
  "foo": 1,
  "bar": 2,
  "text": "a\n  \nb\n\nc\n\nd\n"
}
PASS JSON: PASS H3Z8 Literal unicode
YAML Input
---
wanted: love ♥ and peace ☮
Event Tree Output
+STR
+DOC ---
+MAP
=VAL :wanted
=VAL :love ♥ and peace ☮
-MAP
-DOC
-STR
Expected JSON
{
  "wanted": "love ♥ and peace ☮"
}
Actual JSON
{
  "wanted": "love ♥ and peace ☮"
}
PASS JSON: SKIP H7J7 Node anchor not indented Error Test
YAML Input
key: &x
!!map
  a: b
Event Tree Output
Yamlrw error: expected mapping key at line 2, columns 1-1
PASS JSON: SKIP H7TQ Extra words on %YAML directive Error Test
YAML Input
%YAML 1.2 foo
---
Event Tree Output
Yamlrw error: invalid directive: expected comment or line break after version at line 1, columns 11-11
PASS JSON: PASS HM87:00 Scalars in flow start with syntax char
YAML Input
[:x]
Event Tree Output
+STR
+DOC
+SEQ []
=VAL ::x
-SEQ
-DOC
-STR
Expected JSON
[
  ":x"
]
Actual JSON
[
  ":x"
]
PASS JSON: PASS HM87:01 Scalars in flow start with syntax char
YAML Input
[?x]
Event Tree Output
+STR
+DOC
+SEQ []
=VAL :?x
-SEQ
-DOC
-STR
Expected JSON
[
  "?x"
]
Actual JSON
[
  "?x"
]
PASS JSON: PASS HMK4 Spec Example 2.16. Indentation determines scope
YAML Input
name: Mark McGwire
accomplishment: >
  Mark set a major league
  home run record in 1998.
stats: |
  65 Home Runs
  0.278 Batting Average
Event Tree Output
+STR
+DOC
+MAP
=VAL :name
=VAL :Mark McGwire
=VAL :accomplishment
=VAL >Mark set a major league home run record in 1998.\n
=VAL :stats
=VAL |65 Home Runs\n0.278 Batting Average\n
-MAP
-DOC
-STR
Expected JSON
{
  "name": "Mark McGwire",
  "accomplishment": "Mark set a major league home run record in 1998.\n",
  "stats": "65 Home Runs\n0.278 Batting Average\n"
}
Actual JSON
{
  "name": "Mark McGwire",
  "accomplishment": "Mark set a major league home run record in 1998.\n",
  "stats": "65 Home Runs\n0.278 Batting Average\n"
}
PASS JSON: PASS HMQ5 Spec Example 6.23. Node Properties
YAML Input
!!str &a1 "foo":
  !!str bar
&a2 baz : *a1
Event Tree Output
+STR
+DOC
+MAP
=VAL &a1 <tag:yaml.org,2002:str> "foo
=VAL <tag:yaml.org,2002:str> :bar
=VAL &a2 :baz
=ALI *a1
-MAP
-DOC
-STR
Expected JSON
{
  "foo": "bar",
  "baz": "foo"
}
Actual JSON
{
  "foo": "bar",
  "baz": "foo"
}
PASS JSON: SKIP HRE5 Double quoted scalar with escaped single quote Error Test
YAML Input
---
double: "quoted \' scalar"
Event Tree Output
Yamlrw error: invalid escape sequence: \' at line 2, columns 18-18
PASS JSON: PASS HS5T Spec Example 7.12. Plain Lines
YAML Input
1st non-empty

 2nd non-empty 
	3rd non-empty
Event Tree Output
+STR
+DOC
=VAL :1st non-empty\n2nd non-empty 3rd non-empty
-DOC
-STR
Expected JSON
"1st non-empty\n2nd non-empty 3rd non-empty"
Actual JSON
"1st non-empty\n2nd non-empty 3rd non-empty"
PASS JSON: SKIP HU3P Invalid Mapping in plain scalar Error Test
YAML Input
key:
  word1 word2
  no: key
Event Tree Output
Yamlrw error: expected mapping key at line 3, columns 5-5
PASS JSON: PASS HWV9 Document-end marker
YAML Input
...
Event Tree Output
+STR
-STR
PASS JSON: PASS J3BT Spec Example 5.12. Tabs and Spaces
YAML Input
# Tabs and spaces
quoted: "Quoted 	"
block:	|
  void main() {
  	printf("Hello, world!\n");
  }
Event Tree Output
+STR
+DOC
+MAP
=VAL :quoted
=VAL "Quoted \t
=VAL :block
=VAL |void main() {\n\tprintf("Hello, world!\\n");\n}\n
-MAP
-DOC
-STR
Expected JSON
{
  "quoted": "Quoted \t",
  "block": "void main() {\n\tprintf(\"Hello, world!\\n\");\n}\n"
}
Actual JSON
{
  "quoted": "Quoted \t",
  "block": "void main() {\n\tprintf(\"Hello, world!\\n\");\n}\n"
}
PASS JSON: PASS J5UC Multiple Pair Block Mapping
YAML Input
foo: blue
bar: arrr
baz: jazz
Event Tree Output
+STR
+DOC
+MAP
=VAL :foo
=VAL :blue
=VAL :bar
=VAL :arrr
=VAL :baz
=VAL :jazz
-MAP
-DOC
-STR
Expected JSON
{
  "foo": "blue",
  "bar": "arrr",
  "baz": "jazz"
}
Actual JSON
{
  "foo": "blue",
  "bar": "arrr",
  "baz": "jazz"
}
PASS JSON: PASS J7PZ Spec Example 2.26. Ordered Mappings
YAML Input
# The !!omap tag is one of the optional types
# introduced for YAML 1.1. In 1.2, it is not
# part of the standard tags and should not be
# enabled by default.
# Ordered maps are represented as
# A sequence of mappings, with
# each mapping having one key
--- !!omap
- Mark McGwire: 65
- Sammy Sosa: 63
- Ken Griffy: 58
Event Tree Output
+STR
+DOC ---
+SEQ <tag:yaml.org,2002:omap>
+MAP
=VAL :Mark McGwire
=VAL :65
-MAP
+MAP
=VAL :Sammy Sosa
=VAL :63
-MAP
+MAP
=VAL :Ken Griffy
=VAL :58
-MAP
-SEQ
-DOC
-STR
Expected JSON
[
  {
    "Mark McGwire": 65
  },
  {
    "Sammy Sosa": 63
  },
  {
    "Ken Griffy": 58
  }
]
Actual JSON
[
  {
    "Mark McGwire": 65
  },
  {
    "Sammy Sosa": 63
  },
  {
    "Ken Griffy": 58
  }
]
PASS JSON: PASS J7VC Empty Lines Between Mapping Elements
YAML Input
one: 2


three: 4
Event Tree Output
+STR
+DOC
+MAP
=VAL :one
=VAL :2
=VAL :three
=VAL :4
-MAP
-DOC
-STR
Expected JSON
{
  "one": 2,
  "three": 4
}
Actual JSON
{
  "one": 2,
  "three": 4
}
PASS JSON: PASS J9HZ Spec Example 2.9. Single Document with Two Comments
YAML Input
---
hr: # 1998 hr ranking
  - Mark McGwire
  - Sammy Sosa
rbi:
  # 1998 rbi ranking
  - Sammy Sosa
  - Ken Griffey
Event Tree Output
+STR
+DOC ---
+MAP
=VAL :hr
+SEQ
=VAL :Mark McGwire
=VAL :Sammy Sosa
-SEQ
=VAL :rbi
+SEQ
=VAL :Sammy Sosa
=VAL :Ken Griffey
-SEQ
-MAP
-DOC
-STR
Expected JSON
{
  "hr": [
    "Mark McGwire",
    "Sammy Sosa"
  ],
  "rbi": [
    "Sammy Sosa",
    "Ken Griffey"
  ]
}
Actual JSON
{
  "hr": [
    "Mark McGwire",
    "Sammy Sosa"
  ],
  "rbi": [
    "Sammy Sosa",
    "Ken Griffey"
  ]
}
PASS JSON: PASS JEF9:00 Trailing whitespace in streams
YAML Input
- |+


Event Tree Output
+STR
+DOC
+SEQ
=VAL |\n\n
-SEQ
-DOC
-STR
Expected JSON
[
  "\n\n"
]
Actual JSON
[
  "\n\n"
]
PASS JSON: PASS JEF9:01 Trailing whitespace in streams
YAML Input
- |+
   
Event Tree Output
+STR
+DOC
+SEQ
=VAL |\n
-SEQ
-DOC
-STR
Expected JSON
[
  "\n"
]
Actual JSON
[
  "\n"
]
PASS JSON: PASS JEF9:02 Trailing whitespace in streams
YAML Input
- |+
   
Event Tree Output
+STR
+DOC
+SEQ
=VAL |\n
-SEQ
-DOC
-STR
Expected JSON
[
  "\n"
]
Actual JSON
[
  "\n"
]
PASS JSON: PASS JHB9 Spec Example 2.7. Two Documents in a Stream
YAML Input
# Ranking of 1998 home runs
---
- Mark McGwire
- Sammy Sosa
- Ken Griffey

# Team ranking
---
- Chicago Cubs
- St Louis Cardinals
Event Tree Output
+STR
+DOC ---
+SEQ
=VAL :Mark McGwire
=VAL :Sammy Sosa
=VAL :Ken Griffey
-SEQ
-DOC
+DOC ---
+SEQ
=VAL :Chicago Cubs
=VAL :St Louis Cardinals
-SEQ
-DOC
-STR
Expected JSON
[
  "Mark McGwire",
  "Sammy Sosa",
  "Ken Griffey"
]
[
  "Chicago Cubs",
  "St Louis Cardinals"
]
Actual JSON
[
  "Mark McGwire",
  "Sammy Sosa",
  "Ken Griffey"
]
[
  "Chicago Cubs",
  "St Louis Cardinals"
]
PASS JSON: SKIP JKF3 Multiline unidented double quoted block key Error Test
YAML Input
- - "bar
bar": x
Event Tree Output
Yamlrw error: invalid indentation in quoted scalar at line 2, columns 1-1
PASS JSON: PASS JQ4R Spec Example 8.14. Block Sequence
YAML Input
block sequence:
  - one
  - two : three
Event Tree Output
+STR
+DOC
+MAP
=VAL :block sequence
+SEQ
=VAL :one
+MAP
=VAL :two
=VAL :three
-MAP
-SEQ
-MAP
-DOC
-STR
Expected JSON
{
  "block sequence": [
    "one",
    {
      "two": "three"
    }
  ]
}
Actual JSON
{
  "block sequence": [
    "one",
    {
      "two": "three"
    }
  ]
}
PASS JSON: PASS JR7V Question marks in scalars
YAML Input
- a?string
- another ? string
- key: value?
- [a?string]
- [another ? string]
- {key: value? }
- {key: value?}
- {key?: value }
Event Tree Output
+STR
+DOC
+SEQ
=VAL :a?string
=VAL :another ? string
+MAP
=VAL :key
=VAL :value?
-MAP
+SEQ []
=VAL :a?string
-SEQ
+SEQ []
=VAL :another ? string
-SEQ
+MAP {}
=VAL :key
=VAL :value?
-MAP
+MAP {}
=VAL :key
=VAL :value?
-MAP
+MAP {}
=VAL :key?
=VAL :value
-MAP
-SEQ
-DOC
-STR
Expected JSON
[
  "a?string",
  "another ? string",
  {
    "key": "value?"
  },
  [
    "a?string"
  ],
  [
    "another ? string"
  ],
  {
    "key": "value?"
  },
  {
    "key": "value?"
  },
  {
    "key?": "value"
  }
]
Actual JSON
[
  "a?string",
  "another ? string",
  {
    "key": "value?"
  },
  [
    "a?string"
  ],
  [
    "another ? string"
  ],
  {
    "key": "value?"
  },
  {
    "key": "value?"
  },
  {
    "key?": "value"
  }
]
PASS JSON: PASS JS2J Spec Example 6.29. Node Anchors
YAML Input
First occurrence: &anchor Value
Second occurrence: *anchor
Event Tree Output
+STR
+DOC
+MAP
=VAL :First occurrence
=VAL &anchor :Value
=VAL :Second occurrence
=ALI *anchor
-MAP
-DOC
-STR
Expected JSON
{
  "First occurrence": "Value",
  "Second occurrence": "Value"
}
Actual JSON
{
  "First occurrence": "Value",
  "Second occurrence": "Value"
}
PASS JSON: PASS JTV5 Block Mapping with Multiline Scalars
YAML Input
? a
  true
: null
  d
? e
  42
Event Tree Output
+STR
+DOC
+MAP
=VAL :a true
=VAL :null d
=VAL :e 42
=VAL :
-MAP
-DOC
-STR
Expected JSON
{
  "a true": "null d",
  "e 42": null
}
Actual JSON
{
  "a true": "null d",
  "e 42": null
}
PASS JSON: SKIP JY7Z Trailing content that looks like a mapping Error Test
YAML Input
key1: "quoted1"
key2: "quoted2" no key: nor value
key3: "quoted3"
Event Tree Output
Yamlrw error: expected mapping key at line 2, columns 17-23
PASS JSON: PASS K3WX Colon and adjacent value after comment on next line
YAML Input
---
{ "foo" # comment
  :bar }
Event Tree Output
+STR
+DOC ---
+MAP {}
=VAL "foo
=VAL :bar
-MAP
-DOC
-STR
Expected JSON
{
  "foo": "bar"
}
Actual JSON
{
  "foo": "bar"
}
PASS JSON: PASS K4SU Multiple Entry Block Sequence
YAML Input
- foo
- bar
- 42
Event Tree Output
+STR
+DOC
+SEQ
=VAL :foo
=VAL :bar
=VAL :42
-SEQ
-DOC
-STR
Expected JSON
[
  "foo",
  "bar",
  42
]
Actual JSON
[
  "foo",
  "bar",
  42
]
PASS JSON: PASS K527 Spec Example 6.6. Line Folding
YAML Input
>-
  trimmed
  
 

  as
  space
Event Tree Output
+STR
+DOC
=VAL >trimmed\n\n\nas space
-DOC
-STR
Expected JSON
"trimmed\n\n\nas space"
Actual JSON
"trimmed\n\n\nas space"
PASS JSON: PASS K54U Tab after document header
YAML Input
---	scalar
Event Tree Output
+STR
+DOC ---
=VAL :scalar
-DOC
-STR
Expected JSON
"scalar"
Actual JSON
"scalar"
PASS JSON: PASS K858 Spec Example 8.6. Empty Scalar Chomping
YAML Input
strip: >-

clip: >

keep: |+

Event Tree Output
+STR
+DOC
+MAP
=VAL :strip
=VAL >
=VAL :clip
=VAL >
=VAL :keep
=VAL |\n
-MAP
-DOC
-STR
Expected JSON
{
  "strip": "",
  "clip": "",
  "keep": "\n"
}
Actual JSON
{
  "strip": "",
  "clip": "",
  "keep": "\n"
}
PASS JSON: PASS KH5V:00 Inline tabs in double quoted
YAML Input
"1 inline\ttab"
Event Tree Output
+STR
+DOC
=VAL "1 inline\ttab
-DOC
-STR
Expected JSON
"1 inline\ttab"
Actual JSON
"1 inline\ttab"
PASS JSON: PASS KH5V:01 Inline tabs in double quoted
YAML Input
"2 inline\	tab"
Event Tree Output
+STR
+DOC
=VAL "2 inline\ttab
-DOC
-STR
Expected JSON
"2 inline\ttab"
Actual JSON
"2 inline\ttab"
PASS JSON: PASS KH5V:02 Inline tabs in double quoted
YAML Input
"3 inline	tab"
Event Tree Output
+STR
+DOC
=VAL "3 inline\ttab
-DOC
-STR
Expected JSON
"3 inline\ttab"
Actual JSON
"3 inline\ttab"
PASS JSON: SKIP KK5P Various combinations of explicit block mappings
YAML Input
complex1:
  ? - a
complex2:
  ? - a
  : b
complex3:
  ? - a
  : >
    b
complex4:
  ? >
    a
  :
complex5:
  ? - a
  : - b
Event Tree Output
+STR
+DOC
+MAP
=VAL :complex1
+MAP
+SEQ
=VAL :a
-SEQ
=VAL :
-MAP
=VAL :complex2
+MAP
+SEQ
=VAL :a
-SEQ
=VAL :b
-MAP
=VAL :complex3
+MAP
+SEQ
=VAL :a
-SEQ
=VAL >b\n
-MAP
=VAL :complex4
+MAP
=VAL >a\n
=VAL :
-MAP
=VAL :complex5
+MAP
+SEQ
=VAL :a
-SEQ
+SEQ
=VAL :b
-SEQ
-MAP
-MAP
-DOC
-STR
PASS JSON: PASS KMK3 Block Submapping
YAML Input
foo:
  bar: 1
baz: 2
Event Tree Output
+STR
+DOC
+MAP
=VAL :foo
+MAP
=VAL :bar
=VAL :1
-MAP
=VAL :baz
=VAL :2
-MAP
-DOC
-STR
Expected JSON
{
  "foo": {
    "bar": 1
  },
  "baz": 2
}
Actual JSON
{
  "foo": {
    "bar": 1
  },
  "baz": 2
}
PASS JSON: SKIP KS4U Invalid item after end of flow sequence Error Test
YAML Input
---
[
sequence item
]
invalid item
Event Tree Output
Yamlrw error: unexpected token: content not allowed after document value at lines 5-6
PASS JSON: PASS KSS4 Scalars on --- line
YAML Input
--- "quoted
string"
--- &node foo
Event Tree Output
+STR
+DOC ---
=VAL "quoted string
-DOC
+DOC ---
=VAL &node :foo
-DOC
-STR
Expected JSON
"quoted string"
"foo"
Actual JSON
"quoted string"
"foo"
PASS JSON: PASS L24T:00 Trailing line of spaces
YAML Input
foo: |
  x
   
Event Tree Output
+STR
+DOC
+MAP
=VAL :foo
=VAL |x\n \n
-MAP
-DOC
-STR
Expected JSON
{
  "foo" : "x\n \n"
}
Actual JSON
{
  "foo": "x\n \n"
}
PASS JSON: PASS L24T:01 Trailing line of spaces
YAML Input
foo: |
  x
   
Event Tree Output
+STR
+DOC
+MAP
=VAL :foo
=VAL |x\n \n
-MAP
-DOC
-STR
Expected JSON
{
  "foo" : "x\n \n"
}
Actual JSON
{
  "foo": "x\n \n"
}
PASS JSON: PASS L383 Two scalar docs with trailing comments
YAML Input
--- foo  # comment
--- foo  # comment
Event Tree Output
+STR
+DOC ---
=VAL :foo
-DOC
+DOC ---
=VAL :foo
-DOC
-STR
Expected JSON
"foo"
"foo"
Actual JSON
"foo"
"foo"
PASS JSON: PASS L94M Tags in Explicit Mapping
YAML Input
? !!str a
: !!int 47
? c
: !!str d
Event Tree Output
+STR
+DOC
+MAP
=VAL <tag:yaml.org,2002:str> :a
=VAL <tag:yaml.org,2002:int> :47
=VAL :c
=VAL <tag:yaml.org,2002:str> :d
-MAP
-DOC
-STR
Expected JSON
{
  "a": 47,
  "c": "d"
}
Actual JSON
{
  "a": 47,
  "c": "d"
}
PASS JSON: PASS L9U5 Spec Example 7.11. Plain Implicit Keys
YAML Input
implicit block key : [
  implicit flow key : value,
 ]
Event Tree Output
+STR
+DOC
+MAP
=VAL :implicit block key
+SEQ []
+MAP {}
=VAL :implicit flow key
=VAL :value
-MAP
-SEQ
-MAP
-DOC
-STR
Expected JSON
{
  "implicit block key": [
    {
      "implicit flow key": "value"
    }
  ]
}
Actual JSON
{
  "implicit block key": [
    {
      "implicit flow key": "value"
    }
  ]
}
PASS JSON: PASS LE5A Spec Example 7.24. Flow Nodes
YAML Input
- !!str "a"
- 'b'
- &anchor "c"
- *anchor
- !!str
Event Tree Output
+STR
+DOC
+SEQ
=VAL <tag:yaml.org,2002:str> "a
=VAL 'b
=VAL &anchor "c
=ALI *anchor
=VAL <tag:yaml.org,2002:str> :
-SEQ
-DOC
-STR
Expected JSON
[
  "a",
  "b",
  "c",
  "c",
  ""
]
Actual JSON
[
  "a",
  "b",
  "c",
  "c",
  ""
]
PASS JSON: SKIP LHL4 Invalid tag Error Test
YAML Input
---
!invalid{}tag scalar
Event Tree Output
Yamlrw error: invalid tag: expected whitespace or line break after tag at line 2, columns 1-1
PASS JSON: PASS LP6E Whitespace After Scalars in Flow
YAML Input
- [a, b , c ]
- { "a"  : b
   , c : 'd' ,
   e   : "f"
  }
- [      ]
Event Tree Output
+STR
+DOC
+SEQ
+SEQ []
=VAL :a
=VAL :b
=VAL :c
-SEQ
+MAP {}
=VAL "a
=VAL :b
=VAL :c
=VAL 'd
=VAL :e
=VAL "f
-MAP
+SEQ []
-SEQ
-SEQ
-DOC
-STR
Expected JSON
[
  [
    "a",
    "b",
    "c"
  ],
  {
    "a": "b",
    "c": "d",
    "e": "f"
  },
  []
]
Actual JSON
[
  [
    "a",
    "b",
    "c"
  ],
  {
    "a": "b",
    "c": "d",
    "e": "f"
  },
  []
]
PASS JSON: PASS LQZ7 Spec Example 7.4. Double Quoted Implicit Keys
YAML Input
"implicit block key" : [
  "implicit flow key" : value,
 ]
Event Tree Output
+STR
+DOC
+MAP
=VAL "implicit block key
+SEQ []
+MAP {}
=VAL "implicit flow key
=VAL :value
-MAP
-SEQ
-MAP
-DOC
-STR
Expected JSON
{
  "implicit block key": [
    {
      "implicit flow key": "value"
    }
  ]
}
Actual JSON
{
  "implicit block key": [
    {
      "implicit flow key": "value"
    }
  ]
}
PASS JSON: SKIP LX3P Implicit Flow Mapping Key on one line
YAML Input
[flow]: block
Event Tree Output
+STR
+DOC
+MAP
+SEQ []
=VAL :flow
-SEQ
=VAL :block
-MAP
-DOC
-STR
PASS JSON: PASS M29M Literal Block Scalar
YAML Input
a: |
 ab
 
 cd
 ef
 

...
Event Tree Output
+STR
+DOC
+MAP
=VAL :a
=VAL |ab\n\ncd\nef\n
-MAP
-DOC ...
-STR
Expected JSON
{
  "a": "ab\n\ncd\nef\n"
}
Actual JSON
{
  "a": "ab\n\ncd\nef\n"
}
PASS JSON: SKIP M2N8:00 Question mark edge cases
YAML Input
- ? : x
Event Tree Output
+STR
+DOC
+SEQ
+MAP
+MAP
=VAL :
=VAL :x
-MAP
=VAL :
-MAP
-SEQ
-DOC
-STR
PASS JSON: SKIP M2N8:01 Question mark edge cases
YAML Input
? []: x
Event Tree Output
+STR
+DOC
+MAP
+MAP
+SEQ []
-SEQ
=VAL :x
-MAP
=VAL :
-MAP
-DOC
-STR
PASS JSON: PASS M5C3 Spec Example 8.21. Block Scalar Nodes
YAML Input
literal: |2
  value
folded:
   !foo
  >1
 value
Event Tree Output
+STR
+DOC
+MAP
=VAL :literal
=VAL |value\n
=VAL :folded
=VAL <!foo> >value\n
-MAP
-DOC
-STR
Expected JSON
{
  "literal": "value\n",
  "folded": "value\n"
}
Actual JSON
{
  "literal": "value\n",
  "folded": "value\n"
}
PASS JSON: SKIP M5DY Spec Example 2.11. Mapping between Sequences
YAML Input
? - Detroit Tigers
  - Chicago cubs
:
  - 2001-07-23

? [ New York Yankees,
    Atlanta Braves ]
: [ 2001-07-02, 2001-08-12,
    2001-08-14 ]
Event Tree Output
+STR
+DOC
+MAP
+SEQ
=VAL :Detroit Tigers
=VAL :Chicago cubs
-SEQ
+SEQ
=VAL :2001-07-23
-SEQ
+SEQ []
=VAL :New York Yankees
=VAL :Atlanta Braves
-SEQ
+SEQ []
=VAL :2001-07-02
=VAL :2001-08-12
=VAL :2001-08-14
-SEQ
-MAP
-DOC
-STR
PASS JSON: PASS M6YH Block sequence indentation
YAML Input
- |
 x
-
 foo: bar
-
 - 42
Event Tree Output
+STR
+DOC
+SEQ
=VAL |x\n
+MAP
=VAL :foo
=VAL :bar
-MAP
+SEQ
=VAL :42
-SEQ
-SEQ
-DOC
-STR
Expected JSON
[
  "x\n",
  {
    "foo" : "bar"
  },
  [
    42
  ]
]
Actual JSON
[
  "x\n",
  {
    "foo": "bar"
  },
  [
    42
  ]
]
PASS JSON: PASS M7A3 Spec Example 9.3. Bare Documents
YAML Input
Bare
document
...
# No document
...
|
%!PS-Adobe-2.0 # Not the first line
Event Tree Output
+STR
+DOC
=VAL :Bare document
-DOC ...
+DOC
=VAL |%!PS-Adobe-2.0 # Not the first line\n
-DOC
-STR
Expected JSON
"Bare document"
"%!PS-Adobe-2.0 # Not the first line\n"
Actual JSON
"Bare document"
"%!PS-Adobe-2.0 # Not the first line\n"
PASS JSON: PASS M7NX Nested flow collections
YAML Input
---
{
 a: [
  b, c, {
   d: [e, f]
  }
 ]
}
Event Tree Output
+STR
+DOC ---
+MAP {}
=VAL :a
+SEQ []
=VAL :b
=VAL :c
+MAP {}
=VAL :d
+SEQ []
=VAL :e
=VAL :f
-SEQ
-MAP
-SEQ
-MAP
-DOC
-STR
Expected JSON
{
  "a": [
    "b",
    "c",
    {
      "d": [
        "e",
        "f"
      ]
    }
  ]
}
Actual JSON
{
  "a": [
    "b",
    "c",
    {
      "d": [
        "e",
        "f"
      ]
    }
  ]
}
PASS JSON: PASS M9B4 Spec Example 8.7. Literal Scalar
YAML Input
|
 literal
 	text


Event Tree Output
+STR
+DOC
=VAL |literal\n\ttext\n
-DOC
-STR
Expected JSON
"literal\n\ttext\n"
Actual JSON
"literal\n\ttext\n"
PASS JSON: PASS MJS9 Spec Example 6.7. Block Folding
YAML Input
>
  foo 
 
  	 bar

  baz
Event Tree Output
+STR
+DOC
=VAL >foo \n\n\t bar\n\nbaz\n
-DOC
-STR
Expected JSON
"foo \n\n\t bar\n\nbaz\n"
Actual JSON
"foo \n\n\t bar\n\nbaz\n"
PASS JSON: SKIP MUS6:00 Directive variants Error Test
YAML Input
%YAML 1.1#...
---
Event Tree Output
Yamlrw error: comments must be separated from other tokens by whitespace at line 1, columns 10-10
PASS JSON: SKIP MUS6:01 Directive variants Error Test
YAML Input
%YAML 1.2
---
%YAML 1.2
---
Event Tree Output
Yamlrw error: invalid directive: directives require explicit document end '...' before them at line 3, columns 1-10
PASS JSON: PASS MUS6:02 Directive variants
YAML Input
%YAML  1.1
---
Event Tree Output
+STR
+DOC ---
=VAL :
-DOC
-STR
Expected JSON
null
Actual JSON
null
PASS JSON: PASS MUS6:03 Directive variants
YAML Input
%YAML 	 1.1
---
Event Tree Output
+STR
+DOC ---
=VAL :
-DOC
-STR
Expected JSON
null
Actual JSON
null
PASS JSON: PASS MUS6:04 Directive variants
YAML Input
%YAML 1.1  # comment
---
Event Tree Output
+STR
+DOC ---
=VAL :
-DOC
-STR
Expected JSON
null
Actual JSON
null
PASS JSON: PASS MUS6:05 Directive variants
YAML Input
%YAM 1.1
---
Event Tree Output
+STR
+DOC ---
=VAL :
-DOC
-STR
Expected JSON
null
Actual JSON
null
PASS JSON: PASS MUS6:06 Directive variants
YAML Input
%YAMLL 1.1
---
Event Tree Output
+STR
+DOC ---
=VAL :
-DOC
-STR
Expected JSON
null
Actual JSON
null
PASS JSON: PASS MXS3 Flow Mapping in Block Sequence
YAML Input
- {a: b}
Event Tree Output
+STR
+DOC
+SEQ
+MAP {}
=VAL :a
=VAL :b
-MAP
-SEQ
-DOC
-STR
Expected JSON
[
  {
    "a": "b"
  }
]
Actual JSON
[
  {
    "a": "b"
  }
]
PASS JSON: PASS MYW6 Block Scalar Strip
YAML Input
|-
 ab
 
 
...
Event Tree Output
+STR
+DOC
=VAL |ab
-DOC ...
-STR
Expected JSON
"ab"
Actual JSON
"ab"
PASS JSON: PASS MZX3 Non-Specific Tags on Scalars
YAML Input
- plain
- "double quoted"
- 'single quoted'
- >
  block
- plain again
Event Tree Output
+STR
+DOC
+SEQ
=VAL :plain
=VAL "double quoted
=VAL 'single quoted
=VAL >block\n
=VAL :plain again
-SEQ
-DOC
-STR
Expected JSON
[
  "plain",
  "double quoted",
  "single quoted",
  "block\n",
  "plain again"
]
Actual JSON
[
  "plain",
  "double quoted",
  "single quoted",
  "block\n",
  "plain again"
]
PASS JSON: SKIP N4JP Bad indentation in mapping Error Test
YAML Input
map:
  key1: "quoted1"
 key2: "bad indentation"
Event Tree Output
Yamlrw error: expected mapping key at line 3, columns 2-2
PASS JSON: SKIP N782 Invalid document markers in flow style Error Test
YAML Input
[
--- ,
...
]
Event Tree Output
Yamlrw error: expected sequence end ']' at line 2, columns 1-4
PASS JSON: PASS NAT4 Various empty or newline only quoted strings
YAML Input
---
a: '
  '
b: '  
  '
c: "
  "
d: "  
  "
e: '

  '
f: "

  "
g: '


  '
h: "


  "
Event Tree Output
+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"
}
Actual JSON
{
  "a": " ",
  "b": " ",
  "c": " ",
  "d": " ",
  "e": "\n",
  "f": "\n",
  "g": "\n\n",
  "h": "\n\n"
}
PASS JSON: PASS NB6Z Multiline plain value with tabs on empty lines
YAML Input
key:
  value
  with
  	
  tabs
Event Tree Output
+STR
+DOC
+MAP
=VAL :key
=VAL :value with\ntabs
-MAP
-DOC
-STR
Expected JSON
{
  "key": "value with\ntabs"
}
Actual JSON
{
  "key": "value with\ntabs"
}
PASS JSON: SKIP NHX8 Empty Lines at End of Document
YAML Input
:


Event Tree Output
+STR
+DOC
+MAP
=VAL :
=VAL :
-MAP
-DOC
-STR
PASS JSON: PASS NJ66 Multiline plain flow mapping key
YAML Input
---
- { single line: value}
- { multi
  line: value}
Event Tree Output
+STR
+DOC ---
+SEQ
+MAP {}
=VAL :single line
=VAL :value
-MAP
+MAP {}
=VAL :multi line
=VAL :value
-MAP
-SEQ
-DOC
-STR
Expected JSON
[
  {
    "single line": "value"
  },
  {
    "multi line": "value"
  }
]
Actual JSON
[
  {
    "single line": "value"
  },
  {
    "multi line": "value"
  }
]
PASS JSON: SKIP NKF9 Empty keys in block and flow mapping
YAML Input
---
key: value
: empty key
---
{
 key: value, : empty key
}
---
# empty key and value
:
---
# empty key and value
{ : }
Event Tree Output
+STR
+DOC ---
+MAP
=VAL :key
=VAL :value
=VAL :
=VAL :empty key
-MAP
-DOC
+DOC ---
+MAP {}
=VAL :key
=VAL :value
=VAL :
=VAL :empty key
-MAP
-DOC
+DOC ---
+MAP
=VAL :
=VAL :
-MAP
-DOC
+DOC ---
+MAP {}
=VAL :
=VAL :
-MAP
-DOC
-STR
PASS JSON: PASS NP9H Spec Example 7.5. Double Quoted Line Breaks
YAML Input
"folded 
to a space,	
 
to a line feed, or 	\
 \ 	non-content"
Event Tree Output
+STR
+DOC
=VAL "folded to a space,\nto a line feed, or \t \tnon-content
-DOC
-STR
Expected JSON
"folded to a space,\nto a line feed, or \t \tnon-content"
Actual JSON
"folded to a space,\nto a line feed, or \t \tnon-content"
PASS JSON: PASS P2AD Spec Example 8.1. Block Scalar Header
YAML Input
- | # Empty header↓
 literal
- >1 # Indentation indicator↓
  folded
- |+ # Chomping indicator↓
 keep

- >1- # Both indicators↓
  strip
Event Tree Output
+STR
+DOC
+SEQ
=VAL |literal\n
=VAL > folded\n
=VAL |keep\n\n
=VAL > strip
-SEQ
-DOC
-STR
Expected JSON
[
  "literal\n",
  " folded\n",
  "keep\n\n",
  " strip"
]
Actual JSON
[
  "literal\n",
  " folded\n",
  "keep\n\n",
  " strip"
]
PASS JSON: SKIP P2EQ Invalid sequene item on same line as previous item Error Test
YAML Input
---
- { y: z }- invalid
Event Tree Output
Yamlrw error: block sequence entries are not allowed in this context at line 2, columns 11-11
PASS JSON: PASS P76L Spec Example 6.19. Secondary Tag Handle
YAML Input
%TAG !! tag:example.com,2000:app/
---
!!int 1 - 3 # Interval, not integer
Event Tree Output
+STR
+DOC ---
=VAL <tag:example.com,2000:app/int> :1 - 3
-DOC
-STR
Expected JSON
"1 - 3"
Actual JSON
"1 - 3"
PASS JSON: PASS P94K Spec Example 6.11. Multi-Line Comments
YAML Input
key:    # Comment
        # lines
  value


Event Tree Output
+STR
+DOC
+MAP
=VAL :key
=VAL :value
-MAP
-DOC
-STR
Expected JSON
{
  "key": "value"
}
Actual JSON
{
  "key": "value"
}
PASS JSON: PASS PBJ2 Spec Example 2.3. Mapping Scalars to Sequences
YAML Input
american:
  - Boston Red Sox
  - Detroit Tigers
  - New York Yankees
national:
  - New York Mets
  - Chicago Cubs
  - Atlanta Braves
Event Tree Output
+STR
+DOC
+MAP
=VAL :american
+SEQ
=VAL :Boston Red Sox
=VAL :Detroit Tigers
=VAL :New York Yankees
-SEQ
=VAL :national
+SEQ
=VAL :New York Mets
=VAL :Chicago Cubs
=VAL :Atlanta Braves
-SEQ
-MAP
-DOC
-STR
Expected JSON
{
  "american": [
    "Boston Red Sox",
    "Detroit Tigers",
    "New York Yankees"
  ],
  "national": [
    "New York Mets",
    "Chicago Cubs",
    "Atlanta Braves"
  ]
}
Actual JSON
{
  "american": [
    "Boston Red Sox",
    "Detroit Tigers",
    "New York Yankees"
  ],
  "national": [
    "New York Mets",
    "Chicago Cubs",
    "Atlanta Braves"
  ]
}
PASS JSON: PASS PRH3 Spec Example 7.9. Single Quoted Lines
YAML Input
' 1st non-empty

 2nd non-empty 
	3rd non-empty '
Event Tree Output
+STR
+DOC
=VAL ' 1st non-empty\n2nd non-empty 3rd non-empty 
-DOC
-STR
Expected JSON
" 1st non-empty\n2nd non-empty 3rd non-empty "
Actual JSON
" 1st non-empty\n2nd non-empty 3rd non-empty "
PASS JSON: PASS PUW8 Document start on last line
YAML Input
---
a: b
---
Event Tree Output
+STR
+DOC ---
+MAP
=VAL :a
=VAL :b
-MAP
-DOC
+DOC ---
=VAL :
-DOC
-STR
Expected JSON
{
  "a": "b"
}
null
Actual JSON
{
  "a": "b"
}
null
PASS JSON: SKIP PW8X Anchors on Empty Scalars
YAML Input
- &a
- a
-
  &a : a
  b: &b
-
  &c : &a
-
  ? &d
-
  ? &e
  : &a
Event Tree Output
+STR
+DOC
+SEQ
=VAL &a :
=VAL :a
+MAP
=VAL &a :
=VAL :a
=VAL :b
=VAL &b :
-MAP
+MAP
=VAL &c :
=VAL &a :
-MAP
+MAP
=VAL &d :
=VAL :
-MAP
+MAP
=VAL &e :
=VAL &a :
-MAP
-SEQ
-DOC
-STR
PASS JSON: SKIP Q4CL Trailing content after quoted value Error Test
YAML Input
key1: "quoted1"
key2: "quoted2" trailing content
key3: "quoted3"
Event Tree Output
Yamlrw error: expected mapping key at lines 2-3
PASS JSON: PASS Q5MG Tab at beginning of line followed by a flow mapping
YAML Input
	{}
Event Tree Output
+STR
+DOC
+MAP {}
-MAP
-DOC
-STR
Expected JSON
{}
Actual JSON
{}
PASS JSON: PASS Q88A Spec Example 7.23. Flow Content
YAML Input
- [ a, b ]
- { a: b }
- "a"
- 'b'
- c
Event Tree Output
+STR
+DOC
+SEQ
+SEQ []
=VAL :a
=VAL :b
-SEQ
+MAP {}
=VAL :a
=VAL :b
-MAP
=VAL "a
=VAL 'b
=VAL :c
-SEQ
-DOC
-STR
Expected JSON
[
  [
    "a",
    "b"
  ],
  {
    "a": "b"
  },
  "a",
  "b",
  "c"
]
Actual JSON
[
  [
    "a",
    "b"
  ],
  {
    "a": "b"
  },
  "a",
  "b",
  "c"
]
PASS JSON: PASS Q8AD Spec Example 7.5. Double Quoted Line Breaks [1.3]
YAML Input
---
"folded 
to a space,
 
to a line feed, or 	\
 \ 	non-content"
Event Tree Output
+STR
+DOC ---
=VAL "folded to a space,\nto a line feed, or \t \tnon-content
-DOC
-STR
Expected JSON
"folded to a space,\nto a line feed, or \t \tnon-content"
Actual JSON
"folded to a space,\nto a line feed, or \t \tnon-content"
PASS JSON: SKIP Q9WF Spec Example 6.12. Separation Spaces
YAML Input
{ first: Sammy, last: Sosa }:
# Statistics:
  hr:  # Home runs
     65
  avg: # Average
   0.278
Event Tree Output
+STR
+DOC
+MAP
+MAP {}
=VAL :first
=VAL :Sammy
=VAL :last
=VAL :Sosa
-MAP
+MAP
=VAL :hr
=VAL :65
=VAL :avg
=VAL :0.278
-MAP
-MAP
-DOC
-STR
PASS JSON: SKIP QB6E Wrong indented multiline quoted scalar Error Test
YAML Input
---
quoted: "a
b
c"
Event Tree Output
Yamlrw error: invalid indentation in quoted scalar at line 3, columns 1-1
PASS JSON: PASS QF4Y Spec Example 7.19. Single Pair Flow Mappings
YAML Input
[
foo: bar
]
Event Tree Output
+STR
+DOC
+SEQ []
+MAP {}
=VAL :foo
=VAL :bar
-MAP
-SEQ
-DOC
-STR
Expected JSON
[
  {
    "foo": "bar"
  }
]
Actual JSON
[
  {
    "foo": "bar"
  }
]
PASS JSON: SKIP QLJ7 Tag shorthand used in documents but only defined in the first Error Test
YAML Input
%TAG !prefix! tag:example.com,2011:
--- !prefix!A
a: b
--- !prefix!B
c: d
--- !prefix!C
e: f
Event Tree Output
Yamlrw error: invalid tag: !prefix!B
PASS JSON: PASS QT73 Comment and document-end marker
YAML Input
# comment
...
Event Tree Output
+STR
-STR
PASS JSON: PASS R4YG Spec Example 8.2. Block Indentation Indicator
YAML Input
- |
 detected
- >
 
  
  # detected
- |1
  explicit
- >
 	
 detected
Event Tree Output
+STR
+DOC
+SEQ
=VAL |detected\n
=VAL >\n\n# detected\n
=VAL | explicit\n
=VAL >\t\ndetected\n
-SEQ
-DOC
-STR
Expected JSON
[
  "detected\n",
  "\n\n# detected\n",
  " explicit\n",
  "\t\ndetected\n"
]
Actual JSON
[
  "detected\n",
  "\n\n# detected\n",
  " explicit\n",
  "\t\ndetected\n"
]
PASS JSON: PASS R52L Nested flow mapping sequence and mappings
YAML Input
---
{ top1: [item1, {key2: value2}, item3], top2: value2 }
Event Tree Output
+STR
+DOC ---
+MAP {}
=VAL :top1
+SEQ []
=VAL :item1
+MAP {}
=VAL :key2
=VAL :value2
-MAP
=VAL :item3
-SEQ
=VAL :top2
=VAL :value2
-MAP
-DOC
-STR
Expected JSON
{
  "top1": [
    "item1",
    {
      "key2": "value2"
    },
    "item3"
  ],
  "top2": "value2"
}
Actual JSON
{
  "top1": [
    "item1",
    {
      "key2": "value2"
    },
    "item3"
  ],
  "top2": "value2"
}
PASS JSON: SKIP RHX7 YAML directive without document end marker Error Test
YAML Input
---
key: value
%YAML 1.2
---
Event Tree Output
Yamlrw error: unexpected token: directives must be separated from document content by document end marker (...) at line 3, columns 1-1
PASS JSON: PASS RLU9 Sequence Indent
YAML Input
foo:
- 42
bar:
  - 44
Event Tree Output
+STR
+DOC
+MAP
=VAL :foo
+SEQ
=VAL :42
-SEQ
=VAL :bar
+SEQ
=VAL :44
-SEQ
-MAP
-DOC
-STR
Expected JSON
{
  "foo": [
    42
  ],
  "bar": [
    44
  ]
}
Actual JSON
{
  "foo": [
    42
  ],
  "bar": [
    44
  ]
}
PASS JSON: PASS RR7F Mixed Block Mapping (implicit to explicit)
YAML Input
a: 4.2
? d
: 23
Event Tree Output
+STR
+DOC
+MAP
=VAL :a
=VAL :4.2
=VAL :d
=VAL :23
-MAP
-DOC
-STR
Expected JSON
{
  "d": 23,
  "a": 4.2
}
Actual JSON
{
  "a": 4.2,
  "d": 23
}
PASS JSON: PASS RTP8 Spec Example 9.2. Document Markers
YAML Input
%YAML 1.2
---
Document
... # Suffix
Event Tree Output
+STR
+DOC ---
=VAL :Document
-DOC ...
-STR
Expected JSON
"Document"
Actual JSON
"Document"
PASS JSON: SKIP RXY3 Invalid document-end marker in single quoted string Error Test
YAML Input
---
'
...
'
Event Tree Output
Yamlrw error: unclosed single quote at line 2, columns 1-1
PASS JSON: SKIP RZP5 Various Trailing Comments [1.3]
YAML Input
a: "double
  quotes" # lala
b: plain
 value  # lala
c  : #lala
  d
? # lala
 - seq1
: # lala
 - #lala
  seq2
e: &node # lala
 - x: y
block: > # lala
  abcde
Event Tree Output
+STR
+DOC
+MAP
=VAL :a
=VAL "double quotes
=VAL :b
=VAL :plain value
=VAL :c
=VAL :d
+SEQ
=VAL :seq1
-SEQ
+SEQ
=VAL :seq2
-SEQ
=VAL :e
+SEQ &node
+MAP
=VAL :x
=VAL :y
-MAP
-SEQ
=VAL :block
=VAL >abcde\n
-MAP
-DOC
-STR
PASS JSON: PASS RZT7 Spec Example 2.28. Log File
YAML Input
---
Time: 2001-11-23 15:01:42 -5
User: ed
Warning:
  This is an error message
  for the log file
---
Time: 2001-11-23 15:02:31 -5
User: ed
Warning:
  A slightly different error
  message.
---
Date: 2001-11-23 15:03:17 -5
User: ed
Fatal:
  Unknown variable "bar"
Stack:
  - file: TopClass.py
    line: 23
    code: |
      x = MoreObject("345\n")
  - file: MoreClass.py
    line: 58
    code: |-
      foo = bar
Event Tree Output
+STR
+DOC ---
+MAP
=VAL :Time
=VAL :2001-11-23 15:01:42 -5
=VAL :User
=VAL :ed
=VAL :Warning
=VAL :This is an error message for the log file
-MAP
-DOC
+DOC ---
+MAP
=VAL :Time
=VAL :2001-11-23 15:02:31 -5
=VAL :User
=VAL :ed
=VAL :Warning
=VAL :A slightly different error message.
-MAP
-DOC
+DOC ---
+MAP
=VAL :Date
=VAL :2001-11-23 15:03:17 -5
=VAL :User
=VAL :ed
=VAL :Fatal
=VAL :Unknown variable "bar"
=VAL :Stack
+SEQ
+MAP
=VAL :file
=VAL :TopClass.py
=VAL :line
=VAL :23
=VAL :code
=VAL |x = MoreObject("345\\n")\n
-MAP
+MAP
=VAL :file
=VAL :MoreClass.py
=VAL :line
=VAL :58
=VAL :code
=VAL |foo = bar
-MAP
-SEQ
-MAP
-DOC
-STR
Expected JSON
{
  "Time": "2001-11-23 15:01:42 -5",
  "User": "ed",
  "Warning": "This is an error message for the log file"
}
{
  "Time": "2001-11-23 15:02:31 -5",
  "User": "ed",
  "Warning": "A slightly different error message."
}
{
  "Date": "2001-11-23 15:03:17 -5",
  "User": "ed",
  "Fatal": "Unknown variable \"bar\"",
  "Stack": [
    {
      "file": "TopClass.py",
      "line": 23,
      "code": "x = MoreObject(\"345\\n\")\n"
    },
    {
      "file": "MoreClass.py",
      "line": 58,
      "code": "foo = bar"
    }
  ]
}
Actual JSON
{
  "Time": "2001-11-23 15:01:42 -5",
  "User": "ed",
  "Warning": "This is an error message for the log file"
}
{
  "Time": "2001-11-23 15:02:31 -5",
  "User": "ed",
  "Warning": "A slightly different error message."
}
{
  "Date": "2001-11-23 15:03:17 -5",
  "User": "ed",
  "Fatal": "Unknown variable \"bar\"",
  "Stack": [
    {
      "file": "TopClass.py",
      "line": 23,
      "code": "x = MoreObject(\"345\\n\")\n"
    },
    {
      "file": "MoreClass.py",
      "line": 58,
      "code": "foo = bar"
    }
  ]
}
PASS JSON: SKIP S3PD Spec Example 8.18. Implicit Block Mapping Entries
YAML Input
plain key: in-line value
: # Both empty
"quoted key":
- entry
Event Tree Output
+STR
+DOC
+MAP
=VAL :plain key
=VAL :in-line value
=VAL :
=VAL :
=VAL "quoted key
+SEQ
=VAL :entry
-SEQ
-MAP
-DOC
-STR
PASS JSON: SKIP S4GJ Invalid text after block scalar indicator Error Test
YAML Input
---
folded: > first line
  second line
Event Tree Output
Yamlrw error: invalid block scalar header: expected newline after header at line 2, columns 11-11
PASS JSON: PASS S4JQ Spec Example 6.28. Non-Specific Tags
YAML Input
# Assuming conventional resolution:
- "12"
- 12
- ! 12
Event Tree Output
+STR
+DOC
+SEQ
=VAL "12
=VAL :12
=VAL <!> :12
-SEQ
-DOC
-STR
Expected JSON
[
  "12",
  12,
  "12"
]
Actual JSON
[
  "12",
  12,
  "12"
]
PASS JSON: PASS S4T7 Document with footer
YAML Input
aaa: bbb
...
Event Tree Output
+STR
+DOC
+MAP
=VAL :aaa
=VAL :bbb
-MAP
-DOC ...
-STR
Expected JSON
{
  "aaa": "bbb"
}
Actual JSON
{
  "aaa": "bbb"
}
PASS JSON: PASS S7BG Colon followed by comma
YAML Input
---
- :,
Event Tree Output
+STR
+DOC ---
+SEQ
=VAL ::,
-SEQ
-DOC
-STR
Expected JSON
[
  ":,"
]
Actual JSON
[
  ":,"
]
PASS JSON: SKIP S98Z Block scalar with more spaces than first content line Error Test
YAML Input
empty block scalar: >
 
  
   
 # comment
Event Tree Output
Yamlrw error: invalid block scalar header: wrongly indented line in block scalar at line 5, columns 2-2
PASS JSON: PASS S9E8 Spec Example 5.3. Block Structure Indicators
YAML Input
sequence:
- one
- two
mapping:
  ? sky
  : blue
  sea : green
Event Tree Output
+STR
+DOC
+MAP
=VAL :sequence
+SEQ
=VAL :one
=VAL :two
-SEQ
=VAL :mapping
+MAP
=VAL :sky
=VAL :blue
=VAL :sea
=VAL :green
-MAP
-MAP
-DOC
-STR
Expected JSON
{
  "sequence": [
    "one",
    "two"
  ],
  "mapping": {
    "sky": "blue",
    "sea": "green"
  }
}
Actual JSON
{
  "sequence": [
    "one",
    "two"
  ],
  "mapping": {
    "sky": "blue",
    "sea": "green"
  }
}
PASS JSON: SKIP SBG9 Flow Sequence in Flow Mapping
YAML Input
{a: [b, c], [d, e]: f}
Event Tree Output
+STR
+DOC
+MAP {}
=VAL :a
+SEQ []
=VAL :b
=VAL :c
-SEQ
+SEQ []
=VAL :d
=VAL :e
-SEQ
=VAL :f
-MAP
-DOC
-STR
PASS JSON: SKIP SF5V Duplicate YAML directive Error Test
YAML Input
%YAML 1.2
%YAML 1.2
---
Event Tree Output
Yamlrw error: invalid YAML version: duplicate YAML directive at line 2, columns 1-10
PASS JSON: PASS SKE5 Anchor before zero indented sequence
YAML Input
---
seq:
 &anchor
- a
- b
Event Tree Output
+STR
+DOC ---
+MAP
=VAL :seq
+SEQ &anchor
=VAL :a
=VAL :b
-SEQ
-MAP
-DOC
-STR
Expected JSON
{
  "seq": [
    "a",
    "b"
  ]
}
Actual JSON
{
  "seq": [
    "a",
    "b"
  ]
}
PASS JSON: PASS SM9W:00 Single character streams
YAML Input
-
Event Tree Output
+STR
+DOC
+SEQ
=VAL :
-SEQ
-DOC
-STR
Expected JSON
[null]
Actual JSON
[
  null
]
PASS JSON: SKIP SM9W:01 Single character streams
YAML Input
:
Event Tree Output
+STR
+DOC
+MAP
=VAL :
=VAL :
-MAP
-DOC
-STR
PASS JSON: SKIP SR86 Anchor plus Alias Error Test
YAML Input
key1: &a value
key2: &b *a
Event Tree Output
Yamlrw error: expected mapping key at line 2, columns 10-12
PASS JSON: PASS SSW6 Spec Example 7.7. Single Quoted Characters [1.3]
YAML Input
---
'here''s to "quotes"'
Event Tree Output
+STR
+DOC ---
=VAL 'here's to "quotes"
-DOC
-STR
Expected JSON
"here's to \"quotes\""
Actual JSON
"here's to \"quotes\""
PASS JSON: SKIP SU5Z Comment without whitespace after doublequoted scalar Error Test
YAML Input
key: "value"# invalid comment
Event Tree Output
Yamlrw error: comments must be separated from other tokens by whitespace at line 1, columns 13-13
PASS JSON: SKIP SU74 Anchor and alias as mapping key Error Test
YAML Input
key1: &alias value1
&b *alias : value2
Event Tree Output
Yamlrw error: expected mapping key at line 2, columns 4-10
PASS JSON: SKIP SY6V Anchor before sequence entry on same line Error Test
YAML Input
&anchor - sequence entry
Event Tree Output
Yamlrw error: block sequence entries are not allowed in this context at line 1, columns 9-9
PASS JSON: PASS SYW4 Spec Example 2.2. Mapping Scalars to Scalars
YAML Input
hr:  65    # Home runs
avg: 0.278 # Batting average
rbi: 147   # Runs Batted In
Event Tree Output
+STR
+DOC
+MAP
=VAL :hr
=VAL :65
=VAL :avg
=VAL :0.278
=VAL :rbi
=VAL :147
-MAP
-DOC
-STR
Expected JSON
{
  "hr": 65,
  "avg": 0.278,
  "rbi": 147
}
Actual JSON
{
  "hr": 65,
  "avg": 0.278,
  "rbi": 147
}
PASS JSON: PASS T26H Spec Example 8.8. Literal Content [1.3]
YAML Input
--- |
 
  
  literal
   
  
  text

 # Comment
Event Tree Output
+STR
+DOC ---
=VAL |\n\nliteral\n \n\ntext\n
-DOC
-STR
Expected JSON
"\n\nliteral\n \n\ntext\n"
Actual JSON
"\n\nliteral\n \n\ntext\n"
PASS JSON: PASS T4YY Spec Example 7.9. Single Quoted Lines [1.3]
YAML Input
---
' 1st non-empty

 2nd non-empty 
 3rd non-empty '
Event Tree Output
+STR
+DOC ---
=VAL ' 1st non-empty\n2nd non-empty 3rd non-empty 
-DOC
-STR
Expected JSON
" 1st non-empty\n2nd non-empty 3rd non-empty "
Actual JSON
" 1st non-empty\n2nd non-empty 3rd non-empty "
PASS JSON: PASS T5N4 Spec Example 8.7. Literal Scalar [1.3]
YAML Input
--- |
 literal
 	text


Event Tree Output
+STR
+DOC ---
=VAL |literal\n\ttext\n
-DOC
-STR
Expected JSON
"literal\n\ttext\n"
Actual JSON
"literal\n\ttext\n"
PASS JSON: SKIP T833 Flow mapping missing a separating comma Error Test
YAML Input
---
{
 foo: 1
 bar: 2 }
Event Tree Output
Yamlrw error: expected mapping end '}' at line 4, columns 5-7
PASS JSON: SKIP TD5N Invalid scalar after sequence Error Test
YAML Input
- item1
- item2
invalid
Event Tree Output
Yamlrw error: expected mapping key at line 3, columns 1-1
PASS JSON: PASS TE2A Spec Example 8.16. Block Mappings
YAML Input
block mapping:
 key: value
Event Tree Output
+STR
+DOC
+MAP
=VAL :block mapping
+MAP
=VAL :key
=VAL :value
-MAP
-MAP
-DOC
-STR
Expected JSON
{
  "block mapping": {
    "key": "value"
  }
}
Actual JSON
{
  "block mapping": {
    "key": "value"
  }
}
PASS JSON: PASS TL85 Spec Example 6.8. Flow Folding
YAML Input
"
  foo 
 
  	 bar

  baz
"
Event Tree Output
+STR
+DOC
=VAL " foo\nbar\nbaz 
-DOC
-STR
Expected JSON
" foo\nbar\nbaz "
Actual JSON
" foo\nbar\nbaz "
PASS JSON: PASS TS54 Folded Block Scalar
YAML Input
>
 ab
 cd
 
 ef


 gh
Event Tree Output
+STR
+DOC
=VAL >ab cd\nef\n\ngh\n
-DOC
-STR
Expected JSON
"ab cd\nef\n\ngh\n"
Actual JSON
"ab cd\nef\n\ngh\n"
PASS JSON: PASS U3C3 Spec Example 6.16. “TAG” directive
YAML Input
%TAG !yaml! tag:yaml.org,2002:
---
!yaml!str "foo"
Event Tree Output
+STR
+DOC ---
=VAL <tag:yaml.org,2002:str> "foo
-DOC
-STR
Expected JSON
"foo"
Actual JSON
"foo"
PASS JSON: PASS U3XV Node and Mapping Key Anchors
YAML Input
---
top1: &node1
  &k1 key1: one
top2: &node2 # comment
  key2: two
top3:
  &k3 key3: three
top4:
  &node4
  &k4 key4: four
top5:
  &node5
  key5: five
top6: &val6
  six
top7:
  &val7 seven
Event Tree Output
+STR
+DOC ---
+MAP
=VAL :top1
+MAP &node1
=VAL &k1 :key1
=VAL :one
-MAP
=VAL :top2
+MAP &node2
=VAL :key2
=VAL :two
-MAP
=VAL :top3
+MAP
=VAL &k3 :key3
=VAL :three
-MAP
=VAL :top4
+MAP &node4
=VAL &k4 :key4
=VAL :four
-MAP
=VAL :top5
+MAP &node5
=VAL :key5
=VAL :five
-MAP
=VAL :top6
=VAL &val6 :six
=VAL :top7
=VAL &val7 :seven
-MAP
-DOC
-STR
Expected JSON
{
  "top1": {
    "key1": "one"
  },
  "top2": {
    "key2": "two"
  },
  "top3": {
    "key3": "three"
  },
  "top4": {
    "key4": "four"
  },
  "top5": {
    "key5": "five"
  },
  "top6": "six",
  "top7": "seven"
}
Actual JSON
{
  "top1": {
    "key1": "one"
  },
  "top2": {
    "key2": "two"
  },
  "top3": {
    "key3": "three"
  },
  "top4": {
    "key4": "four"
  },
  "top5": {
    "key5": "five"
  },
  "top6": "six",
  "top7": "seven"
}
PASS JSON: SKIP U44R Bad indentation in mapping (2) Error Test
YAML Input
map:
  key1: "quoted1"
   key2: "bad indentation"
Event Tree Output
Yamlrw error: expected mapping key at line 3, columns 4-4
PASS JSON: SKIP U99R Invalid comma in tag Error Test
YAML Input
- !!str, xxx
Event Tree Output
Yamlrw error: invalid tag: expected whitespace or line break after tag at line 1, columns 3-3
PASS JSON: PASS U9NS Spec Example 2.8. Play by Play Feed from a Game
YAML Input
---
time: 20:03:20
player: Sammy Sosa
action: strike (miss)
...
---
time: 20:03:47
player: Sammy Sosa
action: grand slam
...
Event Tree Output
+STR
+DOC ---
+MAP
=VAL :time
=VAL :20:03:20
=VAL :player
=VAL :Sammy Sosa
=VAL :action
=VAL :strike (miss)
-MAP
-DOC ...
+DOC ---
+MAP
=VAL :time
=VAL :20:03:47
=VAL :player
=VAL :Sammy Sosa
=VAL :action
=VAL :grand slam
-MAP
-DOC ...
-STR
Expected JSON
{
  "time": "20:03:20",
  "player": "Sammy Sosa",
  "action": "strike (miss)"
}
{
  "time": "20:03:47",
  "player": "Sammy Sosa",
  "action": "grand slam"
}
Actual JSON
{
  "time": "20:03:20",
  "player": "Sammy Sosa",
  "action": "strike (miss)"
}
{
  "time": "20:03:47",
  "player": "Sammy Sosa",
  "action": "grand slam"
}
PASS JSON: PASS UDM2 Plain URL in flow mapping
YAML Input
- { url: http://example.org }
Event Tree Output
+STR
+DOC
+SEQ
+MAP {}
=VAL :url
=VAL :http://example.org
-MAP
-SEQ
-DOC
-STR
Expected JSON
[
  {
    "url": "http://example.org"
  }
]
Actual JSON
[
  {
    "url": "http://example.org"
  }
]
PASS JSON: PASS UDR7 Spec Example 5.4. Flow Collection Indicators
YAML Input
sequence: [ one, two, ]
mapping: { sky: blue, sea: green }
Event Tree Output
+STR
+DOC
+MAP
=VAL :sequence
+SEQ []
=VAL :one
=VAL :two
-SEQ
=VAL :mapping
+MAP {}
=VAL :sky
=VAL :blue
=VAL :sea
=VAL :green
-MAP
-MAP
-DOC
-STR
Expected JSON
{
  "sequence": [
    "one",
    "two"
  ],
  "mapping": {
    "sky": "blue",
    "sea": "green"
  }
}
Actual JSON
{
  "sequence": [
    "one",
    "two"
  ],
  "mapping": {
    "sky": "blue",
    "sea": "green"
  }
}
PASS JSON: PASS UGM3 Spec Example 2.27. Invoice
YAML Input
--- !<tag:clarkevans.com,2002:invoice>
invoice: 34843
date   : 2001-01-23
bill-to: &id001
    given  : Chris
    family : Dumars
    address:
        lines: |
            458 Walkman Dr.
            Suite #292
        city    : Royal Oak
        state   : MI
        postal  : 48046
ship-to: *id001
product:
    - sku         : BL394D
      quantity    : 4
      description : Basketball
      price       : 450.00
    - sku         : BL4438H
      quantity    : 1
      description : Super Hoop
      price       : 2392.00
tax  : 251.42
total: 4443.52
comments:
    Late afternoon is best.
    Backup contact is Nancy
    Billsmer @ 338-4338.
Event Tree Output
+STR
+DOC ---
+MAP <tag:clarkevans.com,2002:invoice>
=VAL :invoice
=VAL :34843
=VAL :date
=VAL :2001-01-23
=VAL :bill-to
+MAP &id001
=VAL :given
=VAL :Chris
=VAL :family
=VAL :Dumars
=VAL :address
+MAP
=VAL :lines
=VAL |458 Walkman Dr.\nSuite #292\n
=VAL :city
=VAL :Royal Oak
=VAL :state
=VAL :MI
=VAL :postal
=VAL :48046
-MAP
-MAP
=VAL :ship-to
=ALI *id001
=VAL :product
+SEQ
+MAP
=VAL :sku
=VAL :BL394D
=VAL :quantity
=VAL :4
=VAL :description
=VAL :Basketball
=VAL :price
=VAL :450.00
-MAP
+MAP
=VAL :sku
=VAL :BL4438H
=VAL :quantity
=VAL :1
=VAL :description
=VAL :Super Hoop
=VAL :price
=VAL :2392.00
-MAP
-SEQ
=VAL :tax
=VAL :251.42
=VAL :total
=VAL :4443.52
=VAL :comments
=VAL :Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.
-MAP
-DOC
-STR
Expected JSON
{
  "invoice": 34843,
  "date": "2001-01-23",
  "bill-to": {
    "given": "Chris",
    "family": "Dumars",
    "address": {
      "lines": "458 Walkman Dr.\nSuite #292\n",
      "city": "Royal Oak",
      "state": "MI",
      "postal": 48046
    }
  },
  "ship-to": {
    "given": "Chris",
    "family": "Dumars",
    "address": {
      "lines": "458 Walkman Dr.\nSuite #292\n",
      "city": "Royal Oak",
      "state": "MI",
      "postal": 48046
    }
  },
  "product": [
    {
      "sku": "BL394D",
      "quantity": 4,
      "description": "Basketball",
      "price": 450
    },
    {
      "sku": "BL4438H",
      "quantity": 1,
      "description": "Super Hoop",
      "price": 2392
    }
  ],
  "tax": 251.42,
  "total": 4443.52,
  "comments": "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338."
}
Actual JSON
{
  "invoice": 34843,
  "date": "2001-01-23",
  "bill-to": {
    "given": "Chris",
    "family": "Dumars",
    "address": {
      "lines": "458 Walkman Dr.\nSuite #292\n",
      "city": "Royal Oak",
      "state": "MI",
      "postal": 48046
    }
  },
  "ship-to": {
    "given": "Chris",
    "family": "Dumars",
    "address": {
      "lines": "458 Walkman Dr.\nSuite #292\n",
      "city": "Royal Oak",
      "state": "MI",
      "postal": 48046
    }
  },
  "product": [
    {
      "sku": "BL394D",
      "quantity": 4,
      "description": "Basketball",
      "price": 450
    },
    {
      "sku": "BL4438H",
      "quantity": 1,
      "description": "Super Hoop",
      "price": 2392
    }
  ],
  "tax": 251.42,
  "total": 4443.52,
  "comments": "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338."
}
PASS JSON: SKIP UKK6:00 Syntax character edge cases
YAML Input
- :
Event Tree Output
+STR
+DOC
+SEQ
+MAP
=VAL :
=VAL :
-MAP
-SEQ
-DOC
-STR
PASS JSON: PASS UKK6:01 Syntax character edge cases
YAML Input
::
Event Tree Output
+STR
+DOC
+MAP
=VAL ::
=VAL :
-MAP
-DOC
-STR
Expected JSON
{
  ":": null
}
Actual JSON
{
  ":": null
}
PASS JSON: SKIP UKK6:02 Syntax character edge cases
YAML Input
!
Event Tree Output
+STR
+DOC
=VAL <!> :
-DOC
-STR
PASS JSON: PASS UT92 Spec Example 9.4. Explicit Documents
YAML Input
---
{ matches
% : 20 }
...
---
# Empty
...
Event Tree Output
+STR
+DOC ---
+MAP {}
=VAL :matches %
=VAL :20
-MAP
-DOC ...
+DOC ---
=VAL :
-DOC ...
-STR
Expected JSON
{
  "matches %": 20
}
null
Actual JSON
{
  "matches %": 20
}
null
PASS JSON: PASS UV7Q Legal tab after indentation
YAML Input
x:
 - x
  	x
Event Tree Output
+STR
+DOC
+MAP
=VAL :x
+SEQ
=VAL :x x
-SEQ
-MAP
-DOC
-STR
Expected JSON
{
  "x": [
    "x x"
  ]
}
Actual JSON
{
  "x": [
    "x x"
  ]
}
PASS JSON: PASS V55R Aliases in Block Sequence
YAML Input
- &a a
- &b b
- *a
- *b
Event Tree Output
+STR
+DOC
+SEQ
=VAL &a :a
=VAL &b :b
=ALI *a
=ALI *b
-SEQ
-DOC
-STR
Expected JSON
[
  "a",
  "b",
  "a",
  "b"
]
Actual JSON
[
  "a",
  "b",
  "a",
  "b"
]
PASS JSON: SKIP V9D5 Spec Example 8.19. Compact Block Mappings
YAML Input
- sun: yellow
- ? earth: blue
  : moon: white
Event Tree Output
+STR
+DOC
+SEQ
+MAP
=VAL :sun
=VAL :yellow
-MAP
+MAP
+MAP
=VAL :earth
=VAL :blue
-MAP
+MAP
=VAL :moon
=VAL :white
-MAP
-MAP
-SEQ
-DOC
-STR
PASS JSON: SKIP VJP3:00 Flow collections over many lines Error Test
YAML Input
k: {
k
:
v
}
Event Tree Output
Yamlrw error: invalid indentation in flow construct at line 2, columns 1-1
PASS JSON: PASS VJP3:01 Flow collections over many lines
YAML Input
k: {
 k
 :
 v
 }
Event Tree Output
+STR
+DOC
+MAP
=VAL :k
+MAP {}
=VAL :k
=VAL :v
-MAP
-MAP
-DOC
-STR
Expected JSON
{
  "k" : {
    "k" : "v"
  }
}
Actual JSON
{
  "k": {
    "k": "v"
  }
}
PASS JSON: PASS W42U Spec Example 8.15. Block Sequence Entry Types
YAML Input
- # Empty
- |
 block node
- - one # Compact
  - two # sequence
- one: two # Compact mapping
Event Tree Output
+STR
+DOC
+SEQ
=VAL :
=VAL |block node\n
+SEQ
=VAL :one
=VAL :two
-SEQ
+MAP
=VAL :one
=VAL :two
-MAP
-SEQ
-DOC
-STR
Expected JSON
[
  null,
  "block node\n",
  [
    "one",
    "two"
  ],
  {
    "one": "two"
  }
]
Actual JSON
[
  null,
  "block node\n",
  [
    "one",
    "two"
  ],
  {
    "one": "two"
  }
]
PASS JSON: PASS W4TN Spec Example 9.5. Directives Documents
YAML Input
%YAML 1.2
--- |
%!PS-Adobe-2.0
...
%YAML 1.2
---
# Empty
...
Event Tree Output
+STR
+DOC ---
=VAL |%!PS-Adobe-2.0\n
-DOC ...
+DOC ---
=VAL :
-DOC ...
-STR
Expected JSON
"%!PS-Adobe-2.0\n"
null
Actual JSON
"%!PS-Adobe-2.0\n"
null
PASS JSON: PASS W5VH Allowed characters in alias
YAML Input
a: &:@*!$"<foo>: scalar a
b: *:@*!$"<foo>:
Event Tree Output
+STR
+DOC
+MAP
=VAL :a
=VAL &:@*!$"<foo>: :scalar a
=VAL :b
=ALI *:@*!$"<foo>:
-MAP
-DOC
-STR
Expected JSON
{
  "a": "scalar a",
  "b": "scalar a"
}
Actual JSON
{
  "a": "scalar a",
  "b": "scalar a"
}
PASS JSON: SKIP W9L4 Literal block scalar with more spaces in first line Error Test
YAML Input
---
block scalar: |
     
  more spaces at the beginning
  are invalid
Event Tree Output
Yamlrw error: invalid block scalar header: wrongly indented line in block scalar at line 4, columns 3-3
PASS JSON: PASS WZ62 Spec Example 7.2. Empty Content
YAML Input
{
  foo : !!str,
  !!str : bar,
}
Event Tree Output
+STR
+DOC
+MAP {}
=VAL :foo
=VAL <tag:yaml.org,2002:str> :
=VAL <tag:yaml.org,2002:str> :
=VAL :bar
-MAP
-DOC
-STR
Expected JSON
{
  "foo": "",
  "": "bar"
}
Actual JSON
{
  "foo": "",
  "": "bar"
}
PASS JSON: SKIP X38W Aliases in Flow Objects
YAML Input
{ &a [a, &b b]: *b, *a : [c, *b, d]}
Event Tree Output
+STR
+DOC
+MAP {}
+SEQ [] &a
=VAL :a
=VAL &b :b
-SEQ
=ALI *b
=ALI *a
+SEQ []
=VAL :c
=ALI *b
=VAL :d
-SEQ
-MAP
-DOC
-STR
PASS JSON: SKIP X4QW Comment without whitespace after block scalar indicator Error Test
YAML Input
block: ># comment
  scalar
Event Tree Output
Yamlrw error: comments must be separated from other tokens by whitespace at line 1, columns 9-9
PASS JSON: PASS X8DW Explicit key and value seperated by comment
YAML Input
---
? key
# comment
: value
Event Tree Output
+STR
+DOC ---
+MAP
=VAL :key
=VAL :value
-MAP
-DOC
-STR
Expected JSON
{
  "key": "value"
}
Actual JSON
{
  "key": "value"
}
PASS JSON: PASS XLQ9 Multiline scalar that looks like a YAML directive
YAML Input
---
scalar
%YAML 1.2
Event Tree Output
+STR
+DOC ---
=VAL :scalar %YAML 1.2
-DOC
-STR
Expected JSON
"scalar %YAML 1.2"
Actual JSON
"scalar %YAML 1.2"
PASS JSON: PASS XV9V Spec Example 6.5. Empty Lines [1.3]
YAML Input
Folding:
  "Empty line

  as a line feed"
Chomping: |
  Clipped empty lines
 

Event Tree Output
+STR
+DOC
+MAP
=VAL :Folding
=VAL "Empty line\nas a line feed
=VAL :Chomping
=VAL |Clipped empty lines\n
-MAP
-DOC
-STR
Expected JSON
{
  "Folding": "Empty line\nas a line feed",
  "Chomping": "Clipped empty lines\n"
}
Actual JSON
{
  "Folding": "Empty line\nas a line feed",
  "Chomping": "Clipped empty lines\n"
}
PASS JSON: SKIP XW4D Various Trailing Comments
YAML Input
a: "double
  quotes" # lala
b: plain
 value  # lala
c  : #lala
  d
? # lala
 - seq1
: # lala
 - #lala
  seq2
e:
 &node # lala
 - x: y
block: > # lala
  abcde
Event Tree Output
+STR
+DOC
+MAP
=VAL :a
=VAL "double quotes
=VAL :b
=VAL :plain value
=VAL :c
=VAL :d
+SEQ
=VAL :seq1
-SEQ
+SEQ
=VAL :seq2
-SEQ
=VAL :e
+SEQ &node
+MAP
=VAL :x
=VAL :y
-MAP
-SEQ
=VAL :block
=VAL >abcde\n
-MAP
-DOC
-STR
PASS JSON: PASS Y2GN Anchor with colon in the middle
YAML Input
---
key: &an:chor value
Event Tree Output
+STR
+DOC ---
+MAP
=VAL :key
=VAL &an:chor :value
-MAP
-DOC
-STR
Expected JSON
{
  "key": "value"
}
Actual JSON
{
  "key": "value"
}
PASS JSON: SKIP Y79Y:000 Tabs in various contexts Error Test
YAML Input
foo: |
	
bar: 1
Event Tree Output
Yamlrw error: tab character in indentation at line 2, columns 1-1
PASS JSON: PASS Y79Y:001 Tabs in various contexts
YAML Input
foo: |
 	
bar: 1
Event Tree Output
+STR
+DOC
+MAP
=VAL :foo
=VAL |\t\n
=VAL :bar
=VAL :1
-MAP
-DOC
-STR
Expected JSON
{
  "foo": "\t\n",
  "bar": 1
}
Actual JSON
{
  "foo": "\t\n",
  "bar": 1
}
PASS JSON: PASS Y79Y:002 Tabs in various contexts
YAML Input
- [
	
 foo
 ]
Event Tree Output
+STR
+DOC
+SEQ
+SEQ []
=VAL :foo
-SEQ
-SEQ
-DOC
-STR
Expected JSON
[
  [
    "foo"
  ]
]
Actual JSON
[
  [
    "foo"
  ]
]
PASS JSON: SKIP Y79Y:003 Tabs in various contexts Error Test
YAML Input
- [
	foo,
 foo
 ]
Event Tree Output
Yamlrw error: invalid indentation in flow construct at line 2, columns 1-1
PASS JSON: SKIP Y79Y:004 Tabs in various contexts Error Test
YAML Input
-	-
Event Tree Output
Yamlrw error: tab character in indentation at line 1, columns 1-1
PASS JSON: SKIP Y79Y:005 Tabs in various contexts Error Test
YAML Input
- 	-
Event Tree Output
Yamlrw error: tab character in indentation at line 1, columns 1-1
PASS JSON: SKIP Y79Y:006 Tabs in various contexts Error Test
YAML Input
?	-
Event Tree Output
Yamlrw error: tab character in indentation at line 1, columns 1-1
PASS JSON: SKIP Y79Y:007 Tabs in various contexts Error Test
YAML Input
? -
:	-
Event Tree Output
Yamlrw error: tab character in indentation at line 2, columns 1-1
PASS JSON: SKIP Y79Y:008 Tabs in various contexts Error Test
YAML Input
?	key:
Event Tree Output
Yamlrw error: tab character in indentation at line 1, columns 1-1
PASS JSON: SKIP Y79Y:009 Tabs in various contexts Error Test
YAML Input
? key:
:	key:
Event Tree Output
Yamlrw error: tab character in indentation at line 2, columns 1-1
PASS JSON: PASS Y79Y:010 Tabs in various contexts
YAML Input
-	-1
Event Tree Output
+STR
+DOC
+SEQ
=VAL :-1
-SEQ
-DOC
-STR
Expected JSON
[
  -1
]
Actual JSON
[
  -1
]
PASS JSON: PASS YD5X Spec Example 2.5. Sequence of Sequences
YAML Input
- [name        , hr, avg  ]
- [Mark McGwire, 65, 0.278]
- [Sammy Sosa  , 63, 0.288]
Event Tree Output
+STR
+DOC
+SEQ
+SEQ []
=VAL :name
=VAL :hr
=VAL :avg
-SEQ
+SEQ []
=VAL :Mark McGwire
=VAL :65
=VAL :0.278
-SEQ
+SEQ []
=VAL :Sammy Sosa
=VAL :63
=VAL :0.288
-SEQ
-SEQ
-DOC
-STR
Expected JSON
[
  [
    "name",
    "hr",
    "avg"
  ],
  [
    "Mark McGwire",
    65,
    0.278
  ],
  [
    "Sammy Sosa",
    63,
    0.288
  ]
]
Actual JSON
[
  [
    "name",
    "hr",
    "avg"
  ],
  [
    "Mark McGwire",
    65,
    0.278
  ],
  [
    "Sammy Sosa",
    63,
    0.288
  ]
]
PASS JSON: SKIP YJV2 Dash in flow sequence Error Test
YAML Input
[-]
Event Tree Output
Yamlrw error: unexpected character '-' at line 1, columns 2-2
PASS JSON: PASS Z67P Spec Example 8.21. Block Scalar Nodes [1.3]
YAML Input
literal: |2
  value
folded: !foo >1
 value
Event Tree Output
+STR
+DOC
+MAP
=VAL :literal
=VAL |value\n
=VAL :folded
=VAL <!foo> >value\n
-MAP
-DOC
-STR
Expected JSON
{
  "literal": "value\n",
  "folded": "value\n"
}
Actual JSON
{
  "literal": "value\n",
  "folded": "value\n"
}
PASS JSON: PASS Z9M4 Spec Example 6.22. Global Tag Prefix
YAML Input
%TAG !e! tag:example.com,2000:app/
---
- !e!foo "bar"
Event Tree Output
+STR
+DOC ---
+SEQ
=VAL <tag:example.com,2000:app/foo> "bar
-SEQ
-DOC
-STR
Expected JSON
[
  "bar"
]
Actual JSON
[
  "bar"
]
PASS JSON: SKIP ZCZ6 Invalid mapping in plain single line value Error Test
YAML Input
a: b: c: d
Event Tree Output
Yamlrw error: expected mapping key at line 1, columns 5-5
PASS JSON: PASS ZF4X Spec Example 2.6. Mapping of Mappings
YAML Input
Mark McGwire: {hr: 65, avg: 0.278}
Sammy Sosa: {
    hr: 63,
    avg: 0.288
  }
Event Tree Output
+STR
+DOC
+MAP
=VAL :Mark McGwire
+MAP {}
=VAL :hr
=VAL :65
=VAL :avg
=VAL :0.278
-MAP
=VAL :Sammy Sosa
+MAP {}
=VAL :hr
=VAL :63
=VAL :avg
=VAL :0.288
-MAP
-MAP
-DOC
-STR
Expected JSON
{
  "Mark McGwire": {
    "hr": 65,
    "avg": 0.278
  },
  "Sammy Sosa": {
    "hr": 63,
    "avg": 0.288
  }
}
Actual JSON
{
  "Mark McGwire": {
    "hr": 65,
    "avg": 0.278
  },
  "Sammy Sosa": {
    "hr": 63,
    "avg": 0.288
  }
}
PASS JSON: PASS ZH7C Anchors in Mapping
YAML Input
&a a: b
c: &d d
Event Tree Output
+STR
+DOC
+MAP
=VAL &a :a
=VAL :b
=VAL :c
=VAL &d :d
-MAP
-DOC
-STR
Expected JSON
{
  "a": "b",
  "c": "d"
}
Actual JSON
{
  "a": "b",
  "c": "d"
}
PASS JSON: PASS ZK9H Nested top level flow mapping
YAML Input
{ key: [[[
  value
 ]]]
}
Event Tree Output
+STR
+DOC
+MAP {}
=VAL :key
+SEQ []
+SEQ []
+SEQ []
=VAL :value
-SEQ
-SEQ
-SEQ
-MAP
-DOC
-STR
Expected JSON
{
  "key": [
    [
      [
        "value"
      ]
    ]
  ]
}
Actual JSON
{
  "key": [
    [
      [
        "value"
      ]
    ]
  ]
}
PASS JSON: SKIP ZL4Z Invalid nested mapping Error Test
YAML Input
---
a: 'b': c
Event Tree Output
Yamlrw error: expected mapping key at line 2, columns 7-7
PASS JSON: SKIP ZVH3 Wrong indented sequence item Error Test
YAML Input
- key: value
 - item1
Event Tree Output
Yamlrw error: expected block entry '-' at line 2, columns 2-2
PASS JSON: PASS ZWK4 Key with anchor after missing explicit mapping value
YAML Input
---
a: 1
? b
&anchor c: 3
Event Tree Output
+STR
+DOC ---
+MAP
=VAL :a
=VAL :1
=VAL :b
=VAL :
=VAL &anchor :c
=VAL :3
-MAP
-DOC
-STR
Expected JSON
{
  "a": 1,
  "b": null,
  "c": 3
}
Actual JSON
{
  "a": 1,
  "b": null,
  "c": 3
}
PASS JSON: SKIP ZXT5 Implicit key followed by newline and adjacent value Error Test
YAML Input
[ "key"
  :value ]
Event Tree Output
Yamlrw error: key and ':' must be on the same line in flow context at line 2, columns 3-3