File: 02_undef.t

package info (click to toggle)
libtext-csv-encoded-perl 0.25-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 288 kB
  • sloc: perl: 434; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 468 bytes parent folder | download | duplicates (6)
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

use strict;
use Test::More;

plan tests => 2;

BEGIN {
    local $ENV{PERL_TEXT_CSV} = $ARGV[0] || 0;
    require Text::CSV::Encoded;
}

my $csv = Text::CSV::Encoded->new( { encoding_in => 'utf8', encoding_out => 'shiftjis' } );

$csv->blank_is_undef( 1 );

$csv->parse('abc,"",,"def"');

is_deeply( [ $csv->fields ], [ 'abc', '', undef, 'def' ] );

$csv->blank_is_undef( 0 );

$csv->parse('abc,"",,"def"');

is_deeply( [ $csv->fields ], [ 'abc', '', '', 'def' ] );