This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Updated Parse::CPAN::Meta to CPAN version 1.4401
[perl5.git] / cpan / Parse-CPAN-Meta / t / 03_functions.t
1 #!/usr/bin/perl
2
3 # Testing of basic document structures
4
5 BEGIN {
6         if( $ENV{PERL_CORE} ) {
7                 chdir 't';
8                 @INC = ('../lib', 'lib');
9         }
10         else {
11                 unshift @INC, 't/lib/';
12         }
13 }
14
15 use strict;
16 BEGIN {
17         $|  = 1;
18         $^W = 1;
19 }
20
21 use Test::More tests => 2;
22 use Parse::CPAN::Meta ();
23
24 my $one = <<'END_YAML';
25 ---
26 - foo
27 END_YAML
28
29 my $two = <<'END_YAML';
30 ---
31 - foo
32 ---
33 - bar
34 END_YAML
35
36 my $one_scalar_tiny = Parse::CPAN::Meta::Load( $one );
37 my $two_scalar_tiny = Parse::CPAN::Meta::Load( $two );
38
39 is_deeply( $one_scalar_tiny, [ 'foo' ], 'one: Parsed correctly' );
40 is_deeply( $two_scalar_tiny, [ 'bar' ], 'two: Parsed correctly' );