Skip to content

Commit

Permalink
add escapted sep char test to 71_pp.t
Browse files Browse the repository at this point in the history
  • Loading branch information
makamaka committed Jun 13, 2013
1 parent 26c4e9a commit 6c0aa14
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -16,3 +16,4 @@ tmp/*
ex/*
diff_*
.shipit
t_xs/*
14 changes: 14 additions & 0 deletions t/71_pp.t
Expand Up @@ -325,3 +325,17 @@ is_deeply([$csv->fields], ["6RE","EINKAUF","5","",'2,5" HD']);

}

{ # imported from t/70_rt.t
my $csv = Text::CSV->new ({ escape_char => "\\", auto_diag => 1 });

ok( $csv->parse(q{1,"\,",3}) );
is_deeply ([ $csv->fields ], [ 1, ",", 3 ], "escaped sep in quoted field");
ok( $csv->parse(q{1,"2\,4",3}) );
is_deeply ([ $csv->fields ], [ 1, "2,4", 3 ], "escaped sep in quoted field");

$csv->allow_unquoted_escape(1);
ok( $csv->parse(q{1,\,,3}) );
is_deeply ([ $csv->fields ], [ 1, ",", 3 ], "escaped sep in quoted field");
ok( $csv->parse(q{1,2\,4,3}) );
is_deeply ([ $csv->fields ], [ 1, "2,4", 3 ], "escaped sep in quoted field");
}

0 comments on commit 6c0aa14

Please sign in to comment.