This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
62b84f936e8ae931d578d924501ae5642f2ec254
[perl5.git] / cpan / Parse-CPAN-Meta / t / 18_tap.t
1 #!/usr/bin/perl
2
3 # Testing relating to functionality in the Test Anything Protocol
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(5, 0, 0);
24 use Parse::CPAN::Meta ();
25
26
27
28
29
30 #####################################################################
31 # TAP Tests
32
33 # Make sure we support x-foo keys
34 yaml_ok(
35         "---\nx-foo: 1\n",
36         [ { 'x-foo' => 1 } ],
37         'x-foo key',
38 );
39
40 # Document ending (hash)
41 yaml_ok(
42           "---\n"
43         . "  foo: bar\n"
44         . "...\n",
45         [ { foo => "bar" } ],
46         'document_end_hash',
47         noyamlpm   => 1,
48         nosyck     => 1,
49         noyamlperl => 1,
50 );
51
52 # Document ending (array)
53 yaml_ok(
54           "---\n"
55         . "- foo\n"
56         . "...\n",
57         [ [ 'foo' ] ],
58         'document_end_array',
59         noyamlpm => 1,
60         noyamlperl => 1,
61 );
62
63 # Multiple documents (simple)
64 yaml_ok(
65           "---\n"
66         . "- foo\n"
67         . "...\n"
68         . "---\n"
69         . "- foo\n"
70         . "...\n",
71         [ [ 'foo' ], [ 'foo' ] ],
72         'multi_document_simple',
73         noyamlpm   => 1,
74         noyamlperl => 1,
75 );
76
77 # Multiple documents (whitespace-separated)
78 yaml_ok(
79           "---\n"
80         . "- foo\n"
81         . "...\n"
82         . "\n"
83         . "---\n"
84         . "- foo\n"
85         . "...\n",
86         [ [ 'foo' ], [ 'foo' ] ],
87         'multi_document_space',
88         noyamlpm   => 1,
89         noyamlperl => 1,
90 );