1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
|
#--------------------------------------------------------------------------#
# This file is for testing combinations of sequences and mappings
#--------------------------------------------------------------------------#
#####################################################################
# Null HASH/ARRAY
=== null hash in array
--- yaml
---
- foo
- {}
- bar
--- perl
[ [ 'foo', {}, 'bar' ] ]
=== null array in array
--- yaml
---
- foo
- []
- bar
--- perl
[ [ 'foo', [], 'bar' ] ]
=== null hash in hash
--- yaml
---
foo: {}
bar: 1
--- perl
[ { foo => {}, bar => 1 } ]
=== null array in hash
--- yaml
---
foo: []
bar: 1
--- perl
[ { foo => [], bar => 1 } ]
# Simple array inside a hash with an undef
=== array_in_hash
--- yaml
---
foo:
- bar
- ~
- baz
--- perl
[ { foo => [ 'bar', undef, 'baz' ] } ]
# Simple hash inside a hash with an undef
=== hash_in_hash
--- yaml
---
foo: ~
bar:
foo: bar
--- perl
[ { foo => undef, bar => { foo => 'bar' } } ]
# Mixed hash and scalars inside an array
=== hash_in_array
--- yaml
---
-
foo: ~
this: that
- foo
- ~
-
foo: bar
this: that
--- perl
[ [
{ foo => undef, this => 'that' },
'foo',
undef,
{ foo => 'bar', this => 'that' },
] ]
######################################################################
# Non-Indenting Sub-List
=== Non-indenting sub-list
--- yaml
---
foo:
- list
bar: value
--- perl
[ { foo => [ 'list' ], bar => 'value' } ]
--- noyamlpm
# Inline nested hash
=== inline_nested_hash
--- yaml
---
- ~
- foo: bar
this: that
- baz
--- perl
[ [ undef, { foo => 'bar', this => 'that' }, 'baz' ] ]
# RT 51491
=== space after hypen
--- yaml
\---
FOO:
-
bar: baz
--- perl
[ { 'FOO' => [ { bar => 'baz' } ] } ]
|