Update Parse::CPAN::Meta to 0.04_01
[p5sagit/p5-mst-13.2.git] / lib / Parse / CPAN / Meta / t / 11_meta_yml.t
CommitLineData
be96f5c3 1#!/usr/bin/perl
2
3# Testing of common META.yml examples
4
5BEGIN {
6 if( $ENV{PERL_CORE} ) {
7 chdir 't';
8 @INC = ('../lib', 'lib');
9 }
10 else {
11 unshift @INC, 't/lib/';
12 }
13}
14
15use strict;
16BEGIN {
17 $| = 1;
18 $^W = 1;
19}
20
21use File::Spec::Functions ':ALL';
22use Parse::CPAN::Meta::Test;
23use Test::More tests(8, 2);
24
25
26
27
28
29#####################################################################
30# Testing YAML::Tiny's META.yml file
31
32yaml_ok(
33 <<'END_YAML',
34abstract: Read/Write YAML files with as little code as possible
35author: 'Adam Kennedy <cpan@ali.as>'
36build_requires:
37 File::Spec: 0.80
38 Test::More: 0.47
39distribution_type: module
40generated_by: Module::Install version 0.63
41license: perl
42name: YAML-Tiny
43no_index:
44 directory:
45 - inc
46 - t
47requires:
48 perl: 5.005
49version: 0.03
50END_YAML
51 [ {
52 abstract => 'Read/Write YAML files with as little code as possible',
53 author => 'Adam Kennedy <cpan@ali.as>',
54 build_requires => {
55 'File::Spec' => '0.80',
56 'Test::More' => '0.47',
57 },
58 distribution_type => 'module',
59 generated_by => 'Module::Install version 0.63',
60 license => 'perl',
61 name => 'YAML-Tiny',
62 no_index => {
63 directory => [ qw{inc t} ],
64 },
65 requires => {
66 perl => '5.005',
67 },
68 version => '0.03',
69 } ],
70 'YAML::Tiny',
71);
72
73
74
75
76
77
78#####################################################################
79# Testing a META.yml from a commercial project that crashed
80
81yaml_ok(
82 <<'END_YAML',
83# http://module-build.sourceforge.net/META-spec.html
84#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
85name: ITS-SIN-FIDS-Content-XML
86version: 0.01
87version_from: lib/ITS/SIN/FIDS/Content/XML.pm
88installdirs: site
89requires:
90 Test::More: 0.45
91 XML::Simple: 2
92
93distribution_type: module
94generated_by: ExtUtils::MakeMaker version 6.30
95END_YAML
96 [ {
97 name => 'ITS-SIN-FIDS-Content-XML',
c59d1bfa 98 version => "0.01",
be96f5c3 99 version_from => 'lib/ITS/SIN/FIDS/Content/XML.pm',
100 installdirs => 'site',
101 requires => {
102 'Test::More' => 0.45,
103 'XML::Simple' => 2,
104 },
105 distribution_type => 'module',
106 generated_by => 'ExtUtils::MakeMaker version 6.30',
107 } ],
108 'YAML::Tiny',
109);
110
111
112
113
114
115
116#####################################################################
117# Testing various failing META.yml files from CPAN
118
119yaml_ok(
120 <<'END_YAML',
121---
122abstract: Mii in Nintendo Wii data parser and builder
123author: Toru Yamaguchi <zigorou@cpan.org>
124distribution_type: module
125generated_by: Module::Install version 0.65
126license: perl
127meta-spec:
128 url: http://module-build.sourceforge.net/META-spec-v1.3.html
129 version: 1.3
130name: Games-Nintendo-Wii-Mii
131no_index:
132 directory:
133 - inc
134 - t
135requires:
136 Carp: 1.03
137 Class::Accessor::Fast: 0.3
138 File::Slurp: 9999.12
139 IO::File: 1.1
140 Readonly: 0
141 Tie::IxHash: 1.21
142 URI: 1.35
143 XML::LibXML: 1.62
144version: 0.02
145END_YAML
146 [ {
147 abstract => 'Mii in Nintendo Wii data parser and builder',
148 author => 'Toru Yamaguchi <zigorou@cpan.org>',
149 distribution_type => 'module',
150 generated_by => 'Module::Install version 0.65',
151 license => 'perl',
152 'meta-spec' => {
153 url => 'http://module-build.sourceforge.net/META-spec-v1.3.html',
154 version => '1.3',
155 },
156 name => 'Games-Nintendo-Wii-Mii',
157 no_index => {
158 directory => [ qw{ inc t } ],
159 },
160 requires => {
161 'Carp' => '1.03',
162 'Class::Accessor::Fast' => '0.3',
163 'File::Slurp' => '9999.12',
164 'IO::File' => '1.1',
165 'Readonly' => '0',
166 'Tie::IxHash' => '1.21',
167 'URI' => '1.35',
168 'XML::LibXML' => '1.62',
169 },
170 version => '0.02',
171 } ],
172 'Games-Nintendo-Wii-Mii',
173);
174
175yaml_ok(
176 <<'END_YAML',
177# http://module-build.sourceforge.net/META-spec.html
178#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
179name: Acme-Time-Baby
180version: 2.106
181version_from: Baby.pm
182installdirs: site
183requires:
184 warnings:
185
186distribution_type: module
187generated_by: ExtUtils::MakeMaker version 6.17
188END_YAML
189 [ {
190 name => 'Acme-Time-Baby',
191 version => '2.106',
192 version_from => 'Baby.pm',
193 installdirs => 'site',
194 requires => {
195 warnings => undef,
196 },
197 distribution_type => 'module',
198 generated_by => 'ExtUtils::MakeMaker version 6.17',
199 } ],
200 'Acme-Time-Baby',
201);
202
203
204
205
206
207#####################################################################
208# File with a YAML header
209
210yaml_ok(
211 <<'END_YAML',
212--- %YAML:1.0
213name: Data-Swap
214version: 0.05
215license: perl
216distribution_type: module
217requires:
218 perl: 5.6.0
219dynamic_config: 0
220END_YAML
221 [ {
222 name => 'Data-Swap',
223 version => '0.05',
224 license => 'perl',
225 distribution_type => 'module',
226 requires => {
227 perl => '5.6.0',
228 },
229 dynamic_config => '0',
230 } ],
231 'Data-Swap',
232);
233
234yaml_ok(
235 <<'END_YAML',
236--- #YAML:1.0
237name: Data-Swap
238version: 0.05
239license: perl
240distribution_type: module
241requires:
242 perl: 5.6.0
243dynamic_config: 0
244END_YAML
245 [ {
246 name => 'Data-Swap',
247 version => '0.05',
248 license => 'perl',
249 distribution_type => 'module',
250 requires => {
251 perl => '5.6.0',
252 },
253 dynamic_config => '0',
254 } ],
255 'Data-Swap',
256);
257
258
259
260
261
262#####################################################################
263# Various files that fail for unknown reasons
264
265SCOPE: {
266 my $content = load_ok(
267 'Template-Provider-Unicode-Japanese.yml',
268 catfile( test_data_directory(), 'Template-Provider-Unicode-Japanese.yml' ),
269 100
270 );
271 yaml_ok(
272 $content,
273 [ {
274 abstract => 'Decode all templates by Unicode::Japanese',
275 author => 'Hironori Yoshida C<< <yoshida@cpan.org> >>',
276 distribution_type => 'module',
277 generated_by => 'Module::Install version 0.65',
278 license => 'perl',
279 'meta-spec' => {
280 url => 'http://module-build.sourceforge.net/META-spec-v1.3.html',
281 version => '1.3',
282 },
283 name => 'Template-Provider-Unicode-Japanese',
284 no_index => {
285 directory => [ qw{ inc t } ],
286 },
287 requires => {
288 'Template::Config' => 0,
289 'Unicode::Japanese' => 0,
290 perl => '5.6.0',
291 version => '0',
292 },
293 version => '1.2.1',
294 } ],
295 'Template-Provider-Unicode-Japanese',
296 );
297}
298
299SCOPE: {
300 my $content = load_ok(
301 'HTML-WebDAO.yml',
302 catfile( test_data_directory(), 'HTML-WebDAO.yml' ),
303 100
304 );
305 yaml_ok(
306 $content,
307 [ {
308 abstract => 'Perl extension for create complex web application',
309 author => [
310 'Zahatski Aliaksandr, E<lt>zagap@users.sourceforge.netE<gt>',
311 ],
312 license => 'perl',
313 name => 'HTML-WebDAO',
314 version => '0.04',
315 } ],
316 'HTML-WebDAO',
317 );
318}