Upgrade to Parse::CPAN::Meta 1.38
[p5sagit/p5-mst-13.2.git] / lib / Parse / CPAN / Meta / t / 15_multibyte.t
1 #!/usr/bin/perl
2
3 # Testing of META.yml containing AVAR's name
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 File::Spec::Functions ':ALL';
22 use Parse::CPAN::Meta::Test;
23 use Test::More tests(0, 1, 4);
24
25
26
27
28
29 #####################################################################
30 # Testing that Perl::Smith config files work
31
32 my $sample_file = catfile( test_data_directory(), 'multibyte.yml' );
33 my $sample      = load_ok( 'multibyte.yml', $sample_file, 450 );
34
35 # Does the string parse to the structure
36 my $name      = "multibyte";
37 my $yaml_copy = $sample;
38 my @yaml      = eval { Parse::CPAN::Meta::Load( $yaml_copy ); };
39 is( $@, '', "$name: Parse::CPAN::Meta::Load parses without error" );
40 is( $yaml_copy, $sample, "$name: Parse::CPAN::Meta::Load does not modify the input string" );
41 SKIP: {
42         skip( "Shortcutting after failure", 1 ) if $@;
43         is_deeply( $yaml[0]->{build_requires}, {
44                 'Config'     => 0,
45                 'Test::More' => 0,
46                 'XSLoader'   => 0,
47         }, 'build_requires ok' );
48 }
49
50 SKIP: {
51         skip "no utf8 support", 1 unless Parse::CPAN::Meta::HAVE_UTF8();
52         ok( utf8::is_utf8($yaml[0]->{author}), "utf8 decoded" );
53 }