Linux cpanel2.daytoncreative.net 2.6.32-754.29.2.el6.x86_64 #1 SMP Tue May 12 17:39:04 UTC 2020 x86_64
Apache/2.4.43 (cPanel) OpenSSL/1.1.1g mod_bwlimited/1.4
Server IP : 70.62.220.67 & Your IP : 216.73.216.193
Domains :
Cant Read [ /etc/named.conf ]
User : michaelgreg
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
log /
perl-5.20.2 /
cpan /
Test-Harness /
t /
Delete
Unzip
Name
Size
Permission
Date
Action
compat
[ DIR ]
drwxr-xr-x
2015-02-14 16:55
data
[ DIR ]
drwxr-xr-x
2015-02-14 16:55
lib
[ DIR ]
drwxr-xr-x
2015-02-14 16:55
proverc
[ DIR ]
drwxr-xr-x
2015-02-14 16:55
sample-tests
[ DIR ]
drwxr-xr-x
2015-02-14 16:55
source_tests
[ DIR ]
drwxr-xr-x
2016-10-10 18:24
subclass_tests
[ DIR ]
drwxr-xr-x
2015-02-14 16:55
aggregator.t
9.35
KB
-r--r--r--
2014-12-27 11:48
bailout.t
3.12
KB
-r--r--r--
2014-12-27 11:48
base.t
4.68
KB
-r--r--r--
2014-12-27 11:48
callbacks.t
2.57
KB
-r--r--r--
2014-12-27 11:48
console.t
1.06
KB
-r--r--r--
2014-12-27 11:48
errors.t
4.64
KB
-r--r--r--
2014-12-27 11:48
file.t
13.61
KB
-r--r--r--
2014-12-27 11:48
glob-to-regexp.t
988
B
-r--r--r--
2014-12-27 11:48
grammar.t
11.55
KB
-r--r--r--
2014-12-27 11:48
harness-bailout.t
1.19
KB
-r--r--r--
2014-12-27 11:48
harness-subclass.t
1.58
KB
-r--r--r--
2014-12-27 11:48
harness.t
28.38
KB
-r--r--r--
2014-12-27 11:48
iterator_factory.t
4.8
KB
-r--r--r--
2014-12-27 11:48
iterators.t
5.68
KB
-r--r--r--
2014-12-27 11:48
multiplexer.t
4.53
KB
-r--r--r--
2014-12-27 11:48
nested.t
860
B
-r--r--r--
2014-12-27 11:48
nofork-mux.t
119
B
-r--r--r--
2014-12-27 11:48
nofork.t
1.55
KB
-r--r--r--
2014-12-27 11:48
object.t
772
B
-r--r--r--
2014-12-27 11:48
parse.t
30.97
KB
-r--r--r--
2014-12-27 11:48
parser-config.t
731
B
-r--r--r--
2014-12-27 11:48
parser-subclass.t
2.2
KB
-r--r--r--
2014-12-27 11:48
perl5lib.t
1.13
KB
-r--r--r--
2014-12-27 11:48
premature-bailout.t
2.32
KB
-r--r--r--
2014-12-27 11:48
process.t
1015
B
-r--r--r--
2014-12-27 11:48
prove.t
47.6
KB
-r--r--r--
2014-12-27 11:49
proveenv.t
338
B
-r--r--r--
2014-12-27 11:49
proverc.t
472
B
-r--r--r--
2014-12-27 11:48
proverun.t
4.14
KB
-r--r--r--
2014-12-27 11:48
proveversion.t
763
B
-r--r--r--
2014-12-27 11:48
regression.t
111.62
KB
-r--r--r--
2014-12-27 11:48
results.t
7.68
KB
-r--r--r--
2014-12-27 11:48
scheduler.t
5.33
KB
-r--r--r--
2014-12-27 11:48
source.t
8.21
KB
-r--r--r--
2014-12-27 11:48
source_handler.t
12.32
KB
-r--r--r--
2014-12-27 11:48
spool.t
3.12
KB
-r--r--r--
2014-12-27 11:48
state.t
7.7
KB
-r--r--r--
2014-12-27 11:48
state_results.t
4.95
KB
-r--r--r--
2014-12-27 11:48
streams.t
6.33
KB
-r--r--r--
2014-12-27 11:48
taint.t
1.3
KB
-r--r--r--
2014-12-27 11:49
testargs.t
4.95
KB
-r--r--r--
2014-12-27 11:48
unicode.t
3.73
KB
-r--r--r--
2014-12-27 11:48
yamlish-output.t
2.44
KB
-r--r--r--
2014-12-27 11:48
yamlish-writer.t
7.17
KB
-r--r--r--
2014-12-27 11:48
yamlish.t
15.01
KB
-r--r--r--
2014-12-27 11:48
Save
Rename
#!/usr/bin/perl -w # # Tests for TAP::Parser::IteratorFactory & source detection ## BEGIN { unshift @INC, 't/lib'; } use strict; use warnings; use Test::More tests => 42; use IO::File; use File::Spec; use TAP::Parser::Source; use TAP::Parser::IteratorFactory; # Test generic API... { can_ok 'TAP::Parser::IteratorFactory', 'new'; my $sf = TAP::Parser::IteratorFactory->new; isa_ok $sf, 'TAP::Parser::IteratorFactory'; can_ok $sf, 'config'; can_ok $sf, 'handlers'; can_ok $sf, 'detect_source'; can_ok $sf, 'make_iterator'; can_ok $sf, 'register_handler'; # Set config eval { $sf->config('bad config') }; my $e = $@; like $e, qr/\QArgument to &config must be a hash reference/, '... and calling config with bad config should fail'; my $config = { MySourceHandler => { foo => 'bar' } }; is( $sf->config($config), $sf, '... and set config works' ); # Load/Register a handler $sf = TAP::Parser::IteratorFactory->new( { MySourceHandler => { accept => 'known-source' } } ); can_ok( 'MySourceHandler', 'can_handle' ); is_deeply( $sf->handlers, ['MySourceHandler'], '... was registered' ); # Known source should pass { my $source = TAP::Parser::Source->new->raw( \'known-source' ); my $iterator = eval { $sf->make_iterator($source) }; my $error = $@; ok( !$error, 'make_iterator with known source doesnt fail' ); diag($error) if $error; isa_ok( $iterator, 'MyIterator', '... and iterator class' ); } # No known source should fail { my $source = TAP::Parser::Source->new->raw( \'unknown-source' ); my $iterator = eval { $sf->make_iterator($source) }; my $error = $@; ok( $error, 'make_iterator with unknown source fails' ); like $error, qr/^Cannot detect source of 'unknown-source'/, '... with an appropriate error message'; } } # Source detection use_ok('TAP::Parser::SourceHandler::Executable'); use_ok('TAP::Parser::SourceHandler::Perl'); use_ok('TAP::Parser::SourceHandler::File'); use_ok('TAP::Parser::SourceHandler::RawTAP'); use_ok('TAP::Parser::SourceHandler::Handle'); my $test_dir = File::Spec->catdir( 't', 'source_tests' ); my @sources = ( { file => 'source.tap', handler => 'TAP::Parser::SourceHandler::File', iterator => 'TAP::Parser::Iterator::Stream', }, { file => 'source.1', handler => 'TAP::Parser::SourceHandler::File', config => { File => { extensions => ['.1'] } }, iterator => 'TAP::Parser::Iterator::Stream', }, { file => 'source.pl', handler => 'TAP::Parser::SourceHandler::Perl', iterator => 'TAP::Parser::Iterator::Process', }, { file => 'source.t', handler => 'TAP::Parser::SourceHandler::Perl', iterator => 'TAP::Parser::Iterator::Process', }, { file => 'source', handler => 'TAP::Parser::SourceHandler::Perl', iterator => 'TAP::Parser::Iterator::Process', }, { file => 'source.sh', handler => 'TAP::Parser::SourceHandler::Perl', iterator => 'TAP::Parser::Iterator::Process', }, { file => 'source.bat', handler => 'TAP::Parser::SourceHandler::Executable', iterator => 'TAP::Parser::Iterator::Process', }, { name => 'raw tap string', source => "0..1\nok 1 - raw tap\n", handler => 'TAP::Parser::SourceHandler::RawTAP', iterator => 'TAP::Parser::Iterator::Array', }, { name => 'raw tap array', source => [ "0..1\n", "ok 1 - raw tap\n" ], handler => 'TAP::Parser::SourceHandler::RawTAP', iterator => 'TAP::Parser::Iterator::Array', }, { source => \*__DATA__, handler => 'TAP::Parser::SourceHandler::Handle', iterator => 'TAP::Parser::Iterator::Stream', }, { source => IO::File->new('-'), handler => 'TAP::Parser::SourceHandler::Handle', iterator => 'TAP::Parser::Iterator::Stream', }, ); for my $test (@sources) { local $TODO = $test->{TODO}; if ( $test->{file} ) { $test->{name} = $test->{file}; $test->{source} = File::Spec->catfile( $test_dir, $test->{file} ); } my $name = $test->{name} || substr( $test->{source}, 0, 10 ); my $sf = TAP::Parser::IteratorFactory->new( $test->{config} )->_testing(1); my $raw = $test->{source}; my $source = TAP::Parser::Source->new->raw( ref($raw) ? $raw : \$raw ); my $iterator = eval { $sf->make_iterator($source) }; my $error = $@; ok( !$error, "$name: no error on make_iterator" ); diag($error) if $error; # isa_ok( $iterator, $test->{iterator}, $name ); is( $sf->_last_handler, $test->{handler}, $name ); } __END__ 0..1 ok 1 - TAP in the __DATA__ handle