| 1 |
=== Empty mapping |
| 2 |
--- yaml |
| 3 |
\--- {} |
| 4 |
--- perl |
| 5 |
[ {} ] |
| 6 |
|
| 7 |
# Simple hashs |
| 8 |
=== one_hash1 |
| 9 |
--- yaml |
| 10 |
--- |
| 11 |
foo: bar |
| 12 |
|
| 13 |
--- perl |
| 14 |
[ { foo => 'bar' } ] |
| 15 |
|
| 16 |
|
| 17 |
=== one_hash2 |
| 18 |
--- yaml |
| 19 |
--- |
| 20 |
foo: bar |
| 21 |
this: ~ |
| 22 |
|
| 23 |
--- perl |
| 24 |
[ { this => undef, foo => 'bar' } ] |
| 25 |
|
| 26 |
|
| 27 |
=== one_hash3 |
| 28 |
--- yaml |
| 29 |
--- |
| 30 |
-foo: bar |
| 31 |
|
| 32 |
--- perl |
| 33 |
[ { '-foo' => 'bar' } ] |
| 34 |
|
| 35 |
|
| 36 |
# Implicit document start |
| 37 |
=== implicit_hash |
| 38 |
--- yaml |
| 39 |
foo: bar |
| 40 |
|
| 41 |
--- perl |
| 42 |
[ { foo => 'bar' } ] |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
# Make sure we support x-foo keys |
| 47 |
=== x-foo key |
| 48 |
--- yaml |
| 49 |
--- |
| 50 |
x-foo: 1 |
| 51 |
--- perl |
| 52 |
[ { 'x-foo' => 1 } ] |
| 53 |
|
| 54 |
|
| 55 |
# Hash key legally containing a colon |
| 56 |
=== module_hash_key |
| 57 |
--- yaml |
| 58 |
--- |
| 59 |
Foo::Bar: 1 |
| 60 |
--- perl |
| 61 |
[ { 'Foo::Bar' => 1 } ] |
| 62 |
|
| 63 |
|
| 64 |
# Hash indented |
| 65 |
=== hash_indented |
| 66 |
--- yaml |
| 67 |
--- |
| 68 |
foo: bar |
| 69 |
--- perl |
| 70 |
[ { foo => "bar" } ] |
| 71 |
|
| 72 |
##################################################################### |
| 73 |
# Empty Values and Premature EOF |
| 74 |
|
| 75 |
=== empty hash keys |
| 76 |
--- yaml |
| 77 |
--- |
| 78 |
foo: 0 |
| 79 |
requires: |
| 80 |
build_requires: |
| 81 |
--- perl |
| 82 |
[ { foo => 0, requires => undef, build_requires => undef } ] |
| 83 |
--- noyamlpm |
| 84 |
|
| 85 |
##################################################################### |
| 86 |
# Confirm we can read the synopsis |
| 87 |
|
| 88 |
=== synopsis |
| 89 |
--- yaml |
| 90 |
--- |
| 91 |
rootproperty: blah |
| 92 |
section: |
| 93 |
one: two |
| 94 |
three: four |
| 95 |
Foo: Bar |
| 96 |
empty: ~ |
| 97 |
--- perl |
| 98 |
[ { |
| 99 |
rootproperty => 'blah', |
| 100 |
section => { |
| 101 |
one => 'two', |
| 102 |
three => 'four', |
| 103 |
Foo => 'Bar', |
| 104 |
empty => undef, |
| 105 |
}, |
| 106 |
} ] |
| 107 |
|
| 108 |
##################################################################### |
| 109 |
# Indentation after empty hash value |
| 110 |
|
| 111 |
=== Indentation after empty hash value |
| 112 |
--- yaml |
| 113 |
--- |
| 114 |
Test: |
| 115 |
optmods: |
| 116 |
Bad: 0 |
| 117 |
Foo: 1 |
| 118 |
Long: 0 |
| 119 |
version: 5 |
| 120 |
Test_IncludeA: |
| 121 |
optmods: |
| 122 |
Test_IncludeB: |
| 123 |
optmods: |
| 124 |
_meta: |
| 125 |
name: 'test profile' |
| 126 |
note: 'note this test profile' |
| 127 |
--- perl |
| 128 |
[ { |
| 129 |
Test => { |
| 130 |
optmods => { |
| 131 |
Bad => 0, |
| 132 |
Foo => 1, |
| 133 |
Long => 0, |
| 134 |
}, |
| 135 |
version => 5, |
| 136 |
}, |
| 137 |
Test_IncludeA => { |
| 138 |
optmods => undef, |
| 139 |
}, |
| 140 |
Test_IncludeB => { |
| 141 |
optmods => undef, |
| 142 |
}, |
| 143 |
_meta => { |
| 144 |
name => 'test profile', |
| 145 |
note => 'note this test profile', |
| 146 |
}, |
| 147 |
} ] |
| 148 |
|
| 149 |
|
| 150 |
##################################################################### |
| 151 |
# Spaces in the Key |
| 152 |
|
| 153 |
=== spaces in the key |
| 154 |
--- yaml |
| 155 |
--- |
| 156 |
the key: the value |
| 157 |
--- perl |
| 158 |
[ { 'the key' => 'the value' } ] |
| 159 |
|
| 160 |
|
| 161 |
# Complex keys |
| 162 |
=== key_with_whitespace |
| 163 |
--- yaml |
| 164 |
--- |
| 165 |
a b: c d |
| 166 |
|
| 167 |
--- perl |
| 168 |
[ { 'a b' => 'c d' } ] |
| 169 |
|
| 170 |
=== quoted_empty_key |
| 171 |
--- yaml |
| 172 |
--- |
| 173 |
'': foo |
| 174 |
|
| 175 |
--- perl |
| 176 |
[ { '' => 'foo' } ] |
| 177 |
|
| 178 |
|