1###############################################################################
2#
3# Tests the output of Excel::Writer::XLSX against Excel generated files.
4#
5# Copyright 2000-2021, John McNamara, jmcnamara@cpan.org
6#
7
8use lib 't/lib';
9use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
10use strict;
11use warnings;
12
13use Test::More tests => 1;
14
15###############################################################################
16#
17# Tests setup.
18#
19my $filename     = 'image11.xlsx';
20my $dir          = 't/regression/';
21my $got_filename = $dir . "ewx_$filename";
22my $exp_filename = $dir . 'xlsx_files/' . $filename;
23
24my $ignore_members  = [];
25my $ignore_elements = {};
26
27
28###############################################################################
29#
30# Test the creation of a simple Excel::Writer::XLSX file with image(s).
31#
32use Excel::Writer::XLSX;
33
34my $workbook  = Excel::Writer::XLSX->new( $got_filename );
35my $worksheet = $workbook->add_worksheet();
36
37$worksheet->insert_image( 'C2', $dir . 'images/logo.png', 8, 5 );
38
39$workbook->close();
40
41
42###############################################################################
43#
44# Compare the generated and existing Excel files.
45#
46
47my ( $got, $expected, $caption ) = _compare_xlsx_files(
48
49    $got_filename,
50    $exp_filename,
51    $ignore_members,
52    $ignore_elements,
53);
54
55_is_deep_diff( $got, $expected, $caption );
56
57
58###############################################################################
59#
60# Cleanup.
61#
62unlink $got_filename;
63
64__END__
65
66
67
68