Lines Matching +full:meta +full:- +full:spec

1 #!/usr/bin/perl -w
19 my @meta = ( a => 1, b => 2 );
21 --- #YAML:1.0
26 is($mm->metafile_file(@meta), $expected, "dump for flat hashes works ok");
30 my @meta = ( k1 => 'some key and value', k2 => undef, k3 => 1 );
32 --- #YAML:1.0
38 is($mm->metafile_file(@meta), $expected, "dumping strings and undefs is ok");
42 my @meta = ( a => 1, b => 2, h => { hh => 1 } );
44 --- #YAML:1.0
51 is($mm->metafile_file(@meta), $expected, "dump for nested hashes works ok");
55 my @meta = ( a => 1, b => 2, h => { h1 => 'x', h2 => 'z' } );
57 --- #YAML:1.0
65 is($mm->metafile_file(@meta), $expected, "nested hashes sort ascii-betically");
66 # to tell the truth, they sort case-insensitively
71 my @meta = ( a => 1, b => 2, h => { hh => { hhh => 1 } } );
73 --- #YAML:1.0
81 is($mm->metafile_file(@meta), $expected, "dump for hashes (with more nesting) works ok");
85 my @meta = ( a => 1, k => [ qw(w y z) ] );
87 --- #YAML:1.0
90 - w
91 - y
92 - z
95 is($mm->metafile_file(@meta), $expected, "array of strings are handled ok");
98 is($mm->metafile_file( a => {}, b => [], c => undef ), <<'YAML', 'empty hashes and arrays');
99 --- #YAML:1.0
107 my @meta = (
108 name => 'My-Module',
112 abstract => 'A does-it-all module',
121 'meta-spec' => {
123 url => 'http://module-build.sourceforge.net/META-spec-new.html',
127 --- #YAML:1.0
128 name: My-Module
132 abstract: A does-it-all module
140 meta-spec:
141 url: http://module-build.sourceforge.net/META-spec-new.html
145 is($mm->metafile_file(@meta), $expected, "dump for something like META.yml works");
149 my @meta = (
150 name => 'My-Module',
154 abstract => 'A does-it-all module',
168 'meta-spec' => {
170 url => 'http://module-build.sourceforge.net/META-spec-new.html',
174 --- #YAML:1.0
175 name: My-Module
179 abstract: A does-it-all module
191 meta-spec:
192 url: http://module-build.sourceforge.net/META-spec-new.html
196 is($mm->metafile_file(@meta), $expected, "META.yml with extra 'recommends' works");
200 my @meta = (
201 name => 'My-Module',
205 abstract => 'A does-it-all module',
223 'meta-spec' => {
225 url => 'http://module-build.sourceforge.net/META-spec-new.html',
229 --- #YAML:1.0
230 name: My-Module
234 abstract: A does-it-all module
248 - inc
250 - TODO
251 - NOTES
252 meta-spec:
253 url: http://module-build.sourceforge.net/META-spec-new.html
257 is($mm->metafile_file(@meta), $expected, "META.yml with extra 'no_index' works");
262 skip "Need YAML.pm to test if it can load META.yml", 1
265 my $yaml_load = YAML::Load($mm->metafile_file(@meta));
266 is_deeply( $yaml_load, {@meta}, "META.yml can be read by YAML.pm" );
272 skip "Need YAML::Tiny to test if it can load META.yml", 2
275 my @yaml_load = YAML::Tiny::Load($mm->metafile_file(@meta));
276 is @yaml_load, 1, "YAML::Tiny saw one document in META.yml";
277 is_deeply( $yaml_load[0], {@meta}, "META.yml can be read by YAML::Tiny" );
283 my @meta = ( k => 'a : b', 'x : y' => 1 );
285 --- #YAML:1.0
289 # NOTE: the output is not YAML-equivalent to the input
291 is($mm->metafile_file(@meta), $expected, "no quoting is done");
295 my @meta = ( k => \*STDOUT );
296 eval { $mm->metafile_file(@meta) };
303 my @meta = ( k => [ [] ] );
304 eval { $mm->metafile_file(@meta) };
306 like($@, qr/^only nested arrays of non-refs are supported/,
310 # recursive data structures: don't even think about it - endless recursion