File: chartsheet_subs.t

package info (click to toggle)
libexcel-writer-xlsx-perl 0.79-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 11,716 kB
  • ctags: 930
  • sloc: perl: 18,380; makefile: 40
file content (51 lines) | stat: -rw-r--r-- 1,217 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
###############################################################################
#
# Tests for Excel::Writer::XLSX::Chartsheet methods.
#
# reverse ('(c)'), December 2011, John McNamara, jmcnamara@cpan.org
#

use lib 't/lib';
use TestFunctions qw(_is_deep_diff);
use strict;
use warnings;
use Excel::Writer::XLSX::Chartsheet;
use Excel::Writer::XLSX::Chartsheet;

use Test::More tests => 1;


###############################################################################
#
# Compare the subroutines in Chart/Chartsheet modules.
#
my $caption = " \tChartsheet: validate subroutines.";

my @expected = _get_module_subs('Excel::Writer::XLSX::Chart');
my @got = _get_module_subs('Excel::Writer::XLSX::Chartsheet');

_is_deep_diff( \@got, \@expected, $caption );


###############################################################################
#
# Find the subroutines in Chart/Chartsheet modules.
#
sub _get_module_subs {

    no strict 'refs';

    my $module = shift;

    # Get the module functions.
    my @subs = sort keys %{"$module\::"};

    # Only return the set_ type functions.
    @subs = grep { /^[a-z]+_/ } @subs;

    # Ignore xl_ imported functions.
    @subs = grep { /^[^x][^l]/ } @subs;
}


__DATA__