Lines Matching full:parser

9 use TAP::Parser;
10 use TAP::Parser::Iterator::Array;
11 use TAP::Parser::Iterator::Stream;
13 my $ITER = 'TAP::Parser::Iterator';
18 isa_ok $iterator, 'TAP::Parser::Iterator';
19 my $parser = TAP::Parser->new( { iterator => $iterator } );
20 isa_ok $parser, 'TAP::Parser',
21 '... and creating a streamed parser should succeed';
23 can_ok $parser, '_iterator';
24 is ref $parser->_iterator, $ITER_FH,
26 can_ok $parser, '_stream'; # deprecated
27 is $parser->_stream, $parser->_iterator, '... _stream (deprecated)';
29 can_ok $parser, 'next';
30 is $parser->next->as_string, '1..5',
32 is $parser->next->as_string, 'ok 1 - input file opened',
34 is $parser->next->as_string, '... this is junk',
36 is $parser->next->as_string,
39 is $parser->next->as_string, '# this is a comment',
41 is $parser->next->as_string, 'ok 3 - read the rest of the file',
43 is $parser->next->as_string, 'not ok 4 - this is a real failure',
45 is $parser->next->as_string, 'ok 5 # SKIP we have no description',
48 ok !$parser->parse_errors, '... and we should have no parse errors';
64 ok $parser = TAP::Parser->new( { iterator => $iterator } ),
65 'Now we create a parser with the plan at the end';
66 isa_ok $parser->_iterator, $ITER_ARRAY,
68 is $parser->next->as_string, 'ok 1 - input file opened',
70 is $parser->next->as_string, '... this is junk',
72 is $parser->next->as_string,
75 is $parser->next->as_string, '# this is a comment',
77 is $parser->next->as_string, 'ok 3 - read the rest of the file',
79 is $parser->next->as_string, 'not ok 4 - this is a real failure',
81 is $parser->next->as_string, 'ok 5 # SKIP we have no description',
83 is $parser->next->as_string, '1..5',
86 ok !$parser->parse_errors, '... and we should have no parse errors';
103 ok $parser = TAP::Parser->new( { iterator => $iterator } ),
104 'Now we create a parser with a plan as the second line';
105 is $parser->next->as_string, 'ok 1 - input file opened',
107 is $parser->next->as_string, '1..5',
109 is $parser->next->as_string, '... this is junk',
111 is $parser->next->as_string,
114 is $parser->next->as_string, '# this is a comment',
116 is $parser->next->as_string, 'ok 3 - read the rest of the file',
118 is $parser->next->as_string, 'not ok 4 - this is a real failure',
120 is $parser->next->as_string, 'ok 5 # SKIP we have no description',
123 ok $parser->parse_errors, '... and we should have one parse error';
124 is + ( $parser->parse_errors )[0],
141 ok $parser = TAP::Parser->new( { iterator => $iterator } ),
142 'Now we create a parser with the plan as the second to last line';
143 is $parser->next->as_string, 'ok 1 - input file opened',
145 is $parser->next->as_string, '... this is junk',
147 is $parser->next->as_string,
150 is $parser->next->as_string, '# this is a comment',
152 is $parser->next->as_string, 'ok 3 - read the rest of the file',
154 is $parser->next->as_string, 'not ok 4 - this is a real failure',
156 is $parser->next->as_string, '1..5',
158 is $parser->next->as_string, 'ok 5 # SKIP we have no description',
161 ok $parser->parse_errors, '... and we should have one parse error';
162 is + ( $parser->parse_errors )[0],