3 # Testing of basic document structures
6 if( $ENV{PERL_CORE} ) {
8 @INC = ('../lib', 'lib');
11 unshift @INC, 't/lib/';
21 use File::Spec::Functions ':ALL';
22 use Parse::CPAN::Meta::Test;
23 use Test::More tests(30);
29 #####################################################################
32 # Test a completely empty document
40 ### YAML.pm has a bug where it dies on a single newline
110 "---\n- foo\n- bar\n",
111 [ [ 'foo', 'bar' ] ],
116 [ [ undef, 'bar' ] ],
124 [ { foo => 'bar' } ],
129 "---\nfoo: bar\nthis: ~\n",
130 [ { this => undef, foo => 'bar' } ],
135 # Simple array inside a hash with an undef
144 [ { foo => [ 'bar', undef, 'baz' ] } ],
149 # Simple hash inside a hash with an undef
157 [ { foo => undef, bar => { foo => 'bar' } } ],
162 # Mixed hash and scalars inside an array
176 { foo => undef, this => 'that' },
179 { foo => 'bar', this => 'that' },
185 # Simple single quote
212 "--- \" foo\"\n--- \"bar \"\n",
214 "leading_trailing_spaces",
219 # Implicit document start
222 [ { foo => 'bar' } ],
240 [ [ undef, { foo => 'bar', this => 'that' }, 'baz' ] ],
241 'inline_nested_hash',
247 "---\n- foo\n#\n- bar\n",
248 [ [ 'foo', 'bar' ] ],
249 'empty_comment_in_list',
253 "---\nfoo: bar\n# foo\none: two\n",
254 [ { foo => 'bar', one => 'two' } ],
255 'empty_comment_in_hash',
261 [ { 'a b' => 'c d' } ],
262 'key_with_whitespace',