Move Test::Harness from ext/ to cpan/
[p5sagit/p5-mst-13.2.git] / cpan / Test-Harness / t / parser-config.t
CommitLineData
f7c69158 1#!/usr/bin/perl -w
2
3BEGIN {
f7c69158 4 unshift @INC, 't/lib';
f7c69158 5}
6
7use strict;
8use vars qw(%INIT %CUSTOM);
9
10use Test::More tests => 11;
fbd6575c 11use File::Spec::Functions qw( catfile updir );
f7c69158 12use TAP::Parser;
13
14use_ok('MySource');
15use_ok('MyPerlSource');
16use_ok('MyGrammar');
17use_ok('MyIteratorFactory');
18use_ok('MyResultFactory');
19
2adbc9b6 20my $source = catfile( 't', 'source_tests', 'source' );
f7c69158 21my %customize = (
22 source_class => 'MySource',
23 perl_source_class => 'MyPerlSource',
24 grammar_class => 'MyGrammar',
25 iterator_factory_class => 'MyIteratorFactory',
26 result_factory_class => 'MyResultFactory',
27);
28my $p = TAP::Parser->new(
29 { source => $source,
30 %customize,
31 }
32);
33ok( $p, 'new customized parser' );
34
35foreach my $key ( keys %customize ) {
36 is( $p->$key(), $customize{$key}, "customized $key" );
37}
38
39# TODO: make sure these things are propogated down through the parser...