File: chartsheet_subs.t

package info (click to toggle)
libexcel-writer-xlsx-perl 1.11-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 18,096 kB
  • sloc: perl: 22,147; makefile: 41
file content (57 lines) | stat: -rw-r--r-- 1,382 bytes parent folder | download | duplicates (2)
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
53
54
55
56
57
###############################################################################
#
# Tests for Excel::Writer::XLSX::Chartsheet methods.
#
# Copyright 2000-2023, 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;

    # Add any other methods shared with charts.
    push @subs, ('combine');

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

    # Ignore quote_sheetname imported functions.
    @subs = grep { ! /quote_sheetname/ } @subs;
}


__DATA__