File: 02-read-fh.t

package info (click to toggle)
libspreadsheet-readsxc-perl 0.39-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,368 kB
  • sloc: perl: 1,377; makefile: 8; xml: 2
file content (17 lines) | stat: -rw-r--r-- 496 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!perl
use strict;
use Test::More tests => 1;
use File::Basename 'dirname';
use Spreadsheet::ReadSXC;

my $d = dirname($0);
my $sxc_file = "$d/t.sxc";

open my $fh, '<', $sxc_file
    or die "Couldn't read '$sxc_file': $!";
binmode $fh;
my $workbook_ref_from_fh = Spreadsheet::ReadSXC::read_sxc_fh($fh, { StrictErrors => 1 });
my $workbook_ref = Spreadsheet::ReadSXC::read_sxc($sxc_file);

is_deeply $workbook_ref_from_fh, $workbook_ref,
    "Reading from FH is the same as reading from a file";