File: sub_close.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 (44 lines) | stat: -rw-r--r-- 981 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
###############################################################################
#
# Tests for Excel::Writer::XLSX::Workbook methods.
#
# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org
#

use strict;
use warnings;

use Test::More tests => 2;

###############################################################################
#
# Tests setup.
#
my $filename     = 'sub_close.xlsx';
my $dir          = 't/regression/';
my $ext_filename = $dir . $filename;
my $scalar_target;


###############################################################################
#
# Test the close() method.
#

use Excel::Writer::XLSX;

my $workbook = Excel::Writer::XLSX->new( $ext_filename );
$workbook->add_worksheet();

ok( $workbook->close(), "\tWorkbook: close(), _internal_fh" );
unlink $ext_filename;

open( my $fh, '>', \$scalar_target );
$workbook = Excel::Writer::XLSX->new( $fh );
$workbook->add_worksheet();

ok( $workbook->close(), "\tWorkbook: close(), not _internal_fh" );

__END__