1b39c5158Smillert#!/usr/bin/perl -w
2b39c5158Smillert
3b39c5158SmillertBEGIN {
4b39c5158Smillert    unshift @INC, 't/lib';
5b39c5158Smillert}
6b39c5158Smillert
7b39c5158Smillertuse strict;
8*6fb12b70Safresh1use warnings;
9*6fb12b70Safresh1our (%INIT, %CUSTOM);
10b39c5158Smillert
11898184e3Ssthenuse Test::More tests => 5;
12b39c5158Smillertuse File::Spec::Functions qw( catfile updir );
13b39c5158Smillertuse TAP::Parser;
14b39c5158Smillert
15b39c5158Smillertuse_ok('MyGrammar');
16b39c5158Smillertuse_ok('MyResultFactory');
17b39c5158Smillert
18898184e3Ssthenmy @t_path    = ();
19898184e3Ssthenmy $source    = catfile( @t_path, 't', 'source_tests', 'source' );
20b39c5158Smillertmy %customize = (
21b39c5158Smillert    grammar_class        => 'MyGrammar',
22b39c5158Smillert    result_factory_class => 'MyResultFactory',
23b39c5158Smillert);
24b39c5158Smillertmy $p = TAP::Parser->new(
25b39c5158Smillert    {   source => $source,
26b39c5158Smillert        %customize,
27b39c5158Smillert    }
28b39c5158Smillert);
29b39c5158Smillertok( $p, 'new customized parser' );
30b39c5158Smillert
31898184e3Ssthenfor my $key ( keys %customize ) {
32b39c5158Smillert    is( $p->$key(), $customize{$key}, "customized $key" );
33b39c5158Smillert}
34b39c5158Smillert
35b39c5158Smillert# TODO: make sure these things are propogated down through the parser...
36