File: Test.pm

package info (click to toggle)
libyaml-tiny-perl 1.64-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 556 kB
  • ctags: 80
  • sloc: perl: 1,363; makefile: 2
file content (52 lines) | stat: -rw-r--r-- 874 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package xt::lib::Test;

use strict;
use warnings;

use Exporter   ();

our @ISA    = qw{ Exporter };
our @EXPORT = qw{
    have_yamlpm
    have_yamlsyck
    have_yamlxs
};

# Do we have the authorative YAML to test against
eval {
    require YAML;

    # This doesn't currently work, but is documented to.
    # So if it ever turns up, use it.
    $YAML::UseVersion = 1;
};
my $HAVE_YAMLPM = !! (
    $YAML::VERSION
    and
    $YAML::VERSION >= 0.66
);
sub have_yamlpm { $HAVE_YAMLPM }

# Do we have YAML::Syck to test against?
eval {
    require YAML::Syck;
};
my $HAVE_SYCK = !! (
    $YAML::Syck::VERSION
    and
    $YAML::Syck::VERSION >= 1.05
);
sub have_yamlsyck { $HAVE_SYCK }

# Do we have YAML::XS to test against?
eval {
    require YAML::XS;
};
my $HAVE_XS = !! (
    $YAML::XS::VERSION
    and
    $YAML::XS::VERSION >= 0.29
);
sub have_yamlxs{ $HAVE_XS }

1;