App-SimpleScan
view release on metacpan or search on metacpan
t/11ss_garbage.t view on Meta::CPAN
#!/usr/local/bin/perl
use Test::More tests=>4;
use Test::Differences;
use IO::ScalarArray;
$ENV{HARNESS_PERL_SWITCHES} = "" unless defined $ENV{HARNESS_PERL_SWITCHES};
@output = `$^X $ENV{HARNESS_PERL_SWITCHES} -Iblib/lib bin/simple_scan --gen <examples/ss_garbage1.in`;
@expected = map {"$_\n"} split /\n/,<<EOF;
use Test::More tests=>0;
use Test::WWW::Simple;
use strict;
mech->agent_alias('Windows IE 6');
# This is a file of garbage.
# Possible syntax error in this test spec
# None of this is a valid test.
# Possible syntax error in this test spec
# All of it will be skipped.
# Possible syntax error in this test spec
# No tests will be generated.
# Possible syntax error in this test spec
EOF
push @expected, "\n";
eq_or_diff(\@output, \@expected, "working output as expected");
@output = `$^X $ENV{HARNESS_PERL_SWITCHES} -Iblib/lib bin/simple_scan --gen <examples/ss_garbage2.in`;
@expected = map {"$_\n"} split /\n/,<<EOF;
use Test::More tests=>1;
use Test::WWW::Simple;
use strict;
mech->agent_alias('Windows IE 6');
# Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam vestibulum tortor
# Possible syntax error in this test spec
# sit amet ante. Maecenas lobortis, est a consectetuer molestie, est nulla
# Possible syntax error in this test spec
# gravida justo, et pulvinar dolor sem eget turpis. In massa sem, mollis non,
# Possible syntax error in this test spec
# pulvinar sed, venenatis in, elit. Curabitur odio nunc, feugiat quis, tristique
# Possible syntax error in this test spec
# ac, volutpat eget, elit. In eu risus. Quisque placerat, augue a vehicula
# Possible syntax error in this test spec
# accumsan, est arcu rhoncus ligula, sagittis mollis libero ante aliquet risus.
# Possible syntax error in this test spec
# Aenean sollicitudin adipiscing dolor. Phasellus dictum elit sed neque. Donec
# Possible syntax error in this test spec
# tincidunt elit sit amet dolor. Aenean placerat lorem. Praesent vehicula pede
# Possible syntax error in this test spec
# ac tortor rutrum fermentum. Sed accumsan. Fusce id dui at nulla sodales
# Possible syntax error in this test spec
# dignissim. Aliquam quam erat, porta sit amet, molestie a, laoreet id, ante.
# Possible syntax error in this test spec
# Maecenas tempor lectus congue ligula. Curabitur lacinia diam. Aliquam erat
# Possible syntax error in this test spec
# volutpat.
# Possible syntax error in this test spec
page_like "http://perl.org/",
qr/perl/,
qq(Garbage lines were ignored [http://perl.org/] [/perl/ should match]);
# Donec lorem libero, dictum eget, tempus id, fringilla adipiscing, dolor. Donec
# Possible syntax error in this test spec
( run in 0.657 second using v1.01-cache-2.11-cpan-6aa56a78535 )