1 package Test::ANTLR::Runtime::ANTLRStringStream; 2 3 use ANTLR::Runtime::ANTLRStringStream; 4 use Test::More; 5 6 use Moose; 7 8 BEGIN { extends 'My::Test::Class' } 9 10 sub consume : Test(2) { 11 my ($self) = @_; 12 13 my $s = $self->class->new({ input => 'ABC' }); 14 is $s->LA(1), 'A'; 15 $s->consume(); 16 is $s->LA(1), 'B'; 17 } 18 19 sub LA : Test(5) { 20 my ($self) = @_; 21 22 my $s = $self->class->new({ input => 'ABC' }); 23 is $s->LA(0), undef; 24 is $s->LA(1), 'A'; 25 is $s->LA(2), 'B'; 26 is $s->LA(3), 'C'; 27 is $s->LA(4), ANTLR::Runtime::ANTLRStringStream->EOF; 28 } 29 30 no Moose; 31 __PACKAGE__->meta->make_immutable(inline_constructor => 0); 32 1; 33