App-CSV

 view release on metacpan or  search on metacpan

t/02-basic.t  view on Meta::CPAN

use IO::String;

my $input = <<'.';
"1","2","3"
11,22,33
111,222,333
.

sub setup {
  my $input = shift;
  local @ARGV = @_;
  my $output_fh = IO::String->new;
  my $ac = App::CSV->new_with_options(
    _input_fh  => IO::String->new($input),
    _output_fh => $output_fh);
  return($ac, $output_fh->string_ref);
}

{
  my($ac, $output) = setup($input, 2);  # "csv 2"
  $ac->init;

t/03-file.t  view on Meta::CPAN

      '--input' => $infile, '--output' => $outfile, 2, 1);
  diag("system {$^X} @args");
  system {$^X} @args and die "system: $!";

  diag("temporary output at $outfile");
  is(slurp($outfile), slurp($expected_outfile),
      "$dst - actual commandline invocation produces correct results");
}

sub libs { map { ('-I' => $_) } @INC }
sub slurp { local $/; local @ARGV = pop; <> }

t/04-stdio.t  view on Meta::CPAN

  my @args = ($^X, libs(), $csv_bin, @opts);
  diag("run @args");
  run \@args, \$input, \my $actual_output, \my $stderr or die "run: $?";

  is($actual_output, $expected_output,
      "actual commandline invocation produces correct results");
  is($stderr, "", "nothing on stderr");
}

sub libs { map { ('-I' => $_) } @INC }
sub slurp { local $/; local @ARGV = pop; <> }

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.413 second using v1.00-cache-2.02-grep-82fe00e-cpan-d29e8ade9f55 )