1#!perl
2use strict;
3use Test::More tests => 3;
4use File::Basename 'dirname';
5use Spreadsheet::ReadSXC;
6use Data::Dumper;
7
8my $d = dirname($0);
9my $xml_file = "$d/text-outside-cell.xml";
10
11my $sheet;
12my $ok = eval {
13    $sheet = Spreadsheet::ReadSXC::read_xml_file($xml_file, { StrictErrors => 1 });
14    1;
15};
16my $err = $@;
17is $ok, 1, "We can parse this XML";
18is $@, '', "No error was raised";
19
20is_deeply $sheet, {
21    "Sheet1" => [
22        ['A1','B1',undef,'D1'],
23        ['A2','B2',undef,undef],
24        ['A3',undef,'C3','D3'],
25        ['A4','B4','C4',undef],
26    ],
27    "Second Sheet" => [
28        ['x',undef,'x',undef,'x'],
29        [undef,'x',undef,'x',undef],
30        ['x',undef,'x',undef,'x'],
31    ],
32}, "The sheet looks as we want it"
33or diag Dumper $sheet;
34