App-xml_grep2

 view release on metacpan or  search on metacpan

t/01-options.t  view on Meta::CPAN

system "$PERL -p -e$Q use Cwd; s{PWD}{cwd()}ge;$Q t/catalog.templ > t/catalog";
is( `$XML_GREP2 -t -C $TEST_DIR/catalog $xs1 $TEST_DIR/with_cat.cxml`, "entity c \n", "-C");

is( `$XML_GREP2 --html -t $xp $HTML`, "bar\n", '--html');
is( `$CAT $HTML | $XML_GREP2 --html -t $xp `, "bar\n", '--html (from STDIN)');



my $version= `$XML_GREP2 -V 1 2>&1`;
chomp $version;
like( `$XML_GREP2 -V 1 2>&1`, qr{xml_grep2 version \d+\.\d+$}, "version '$version' looks ok");


sub test_encoding
  { my( $command, $expected, $encoding, $message)= @_;
    unlink $TMP if -f $TMP;
    system( "$command > $TMP") && die "grep error: $@";
    binmode STDIN; 
    my $got= do { undef $/; open( my $in, "<:encoding($encoding)", $TMP) or die "error opening $TMP: $!"; <$in>; };
    is_fuzzy ( $got, $expected, $message);
    binmode STDIN, ':utf8'; 



( run in 0.396 second using v1.01-cache-2.11-cpan-64827b87656 )