Skip to content

Commit

Permalink
Test case for issue #19
Browse files Browse the repository at this point in the history
  • Loading branch information
H.Merijn Brand - Tux committed Jan 30, 2020
1 parent 62224a5 commit 0db4b1e
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions sandbox/issue19.pl
@@ -0,0 +1,32 @@
#!/pro/bin/perl

use 5.16.2;
use warnings;

use Text::CSV_XS;

binmode STDOUT, ":encoding(utf-8)";
binmode STDERR, ":encoding(utf-8)";

my $h = shift // 0;

sub show {
say join ", " => map { "\x{231e}$_\x{231d}" } @_;
} # show

my $csv = Text::CSV_XS->new ({ auto_diag => 2 });
if ($h) {
say "Calling header";
show ($csv->header (*DATA)); # comment out this line to hide the bug
}
while (my $row = $csv->getline (*DATA)) {
show (@$row);
}
$csv->error_diag;
say "EOF: ", $csv->eof ? "Yes" : "No";

__DATA__
Foo,Bar,Baz
a,xxx,1
b,"xx"xx", 2
c, foo , 3

0 comments on commit 0db4b1e

Please sign in to comment.