Math-VectorReal

 view release on metacpan or  search on metacpan

test.pl  view on Meta::CPAN


sub check_script_output {
 my $script = shift;

  print "not " unless -f $script.'.pl';  # script found?
  print "ok ", $testnum++, "\t--- $script script ----\n";

  open(OUT, "$script.out") || die;
  open(TEST, "- |") or exec('perl', $script.'.pl') or exit 0;

  $/='';  # read sections by paragraph
  while( $t = <TEST> ) {
    $o = <OUT>;
    ($testname) = split(/\n/,$t);

    # ignore any white space funny busness
    $t =~ s/\s+/ /; $t =~ s/^\s//; $t =~ s/\s$//;
    $o =~ s/\s+/ /; $o =~ s/^\s//; $o =~ s/\s$//;
    print "not "  if $t ne $o;
    print "ok ", $testnum++, "\t$testname\n"
  }



( run in 0.396 second using v1.01-cache-2.11-cpan-3b35f9de6a3 )