xref: /openbsd-src/gnu/usr.bin/perl/cpan/Test-Harness/t/parser-config.t (revision 91f110e064cd7c194e59e019b83bb7496c1c84d4)
1#!/usr/bin/perl -w
2
3BEGIN {
4    unshift @INC, 't/lib';
5}
6
7use strict;
8use vars qw(%INIT %CUSTOM);
9
10use Test::More tests => 5;
11use File::Spec::Functions qw( catfile updir );
12use TAP::Parser;
13
14use_ok('MyGrammar');
15use_ok('MyResultFactory');
16
17my @t_path    = ();
18my $source    = catfile( @t_path, 't', 'source_tests', 'source' );
19my %customize = (
20    grammar_class        => 'MyGrammar',
21    result_factory_class => 'MyResultFactory',
22);
23my $p = TAP::Parser->new(
24    {   source => $source,
25        %customize,
26    }
27);
28ok( $p, 'new customized parser' );
29
30for my $key ( keys %customize ) {
31    is( $p->$key(), $customize{$key}, "customized $key" );
32}
33
34# TODO: make sure these things are propogated down through the parser...
35