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