This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
e5cb6459bc79c8df2f10eab209f7d7be7c278c82
[perl5.git] / cpan / CPAN-Meta-YAML / t / 19_errors.t
1 #!/usr/bin/perl
2
3 # Testing documents that should fail
4
5 use strict;
6 BEGIN {
7         $|  = 1;
8         $^W = 1;
9 }
10
11 use File::Spec::Functions ':ALL';
12 use t::lib::Test;
13 use Test::More tests => 20;
14 use CPAN::Meta::YAML ();
15
16 my $FEATURE = 'does not support a feature';
17 my $PLAIN   = 'illegal characters in plain scalar';
18
19
20
21
22
23 #####################################################################
24 # Syntactic Errors
25
26 yaml_error( <<'END_YAML', $FEATURE );
27 - 'Multiline
28 quote'
29 END_YAML
30
31 yaml_error( <<'END_YAML', $FEATURE );
32 - "Multiline
33 quote"
34 END_YAML
35
36 yaml_error( <<'END_YAML', $FEATURE );
37 ---
38 version: !!perl/hash:version 
39   original: v2.0.2
40   qv: 1
41   version: 
42     - 2
43     - 0
44     - 2
45 END_YAML
46
47 yaml_error( <<'END_YAML', $PLAIN );
48 - - 2
49 END_YAML
50
51 yaml_error( <<'END_YAML', $PLAIN );
52 foo: -
53 END_YAML
54
55 yaml_error( <<'END_YAML', $PLAIN );
56 foo: @INC
57 END_YAML
58
59 yaml_error( <<'END_YAML', $PLAIN );
60 foo: %INC
61 END_YAML
62
63 yaml_error( <<'END_YAML', $PLAIN );
64 foo: bar:
65 END_YAML
66
67 yaml_error( <<'END_YAML', $PLAIN );
68 foo: bar: baz
69 END_YAML
70
71 yaml_error( <<'END_YAML', $PLAIN );
72 foo: `perl -V`
73 END_YAML