Home | History | Annotate | Download | only in Runtime
      1 package Test::ANTLR::Runtime::CommonToken;
      2 
      3 use Test::More;
      4 
      5 use ANTLR::Runtime::Token;
      6 
      7 use Moose;
      8 
      9 BEGIN { extends 'My::Test::Class' }
     10 
     11 sub constructor : Test(1) {
     12     my $token = ANTLR::Runtime::CommonToken->new({
     13         input => undef,
     14         type => 0,
     15         channel => 0,
     16         start => 0,
     17         stop => 1,
     18     });
     19     is $token->get_start_index(), 0;
     20 }
     21 
     22 sub same : Test(2) {
     23     ok(ANTLR::Runtime::Token->EOF_TOKEN == ANTLR::Runtime::Token->EOF_TOKEN);
     24     ok(ANTLR::Runtime::Token->SKIP_TOKEN == ANTLR::Runtime::Token->SKIP_TOKEN);
     25 }
     26 
     27 sub not_same : Test(2) {
     28     ok !(ANTLR::Runtime::Token->EOF_TOKEN  != ANTLR::Runtime::Token->EOF_TOKEN);
     29     ok !(ANTLR::Runtime::Token->SKIP_TOKEN != ANTLR::Runtime::Token->SKIP_TOKEN);
     30 }
     31 
     32 sub bool_eof : Test(1) {
     33     ok !ANTLR::Runtime::Token->EOF_TOKEN;
     34 }
     35 
     36 no Moose;
     37 __PACKAGE__->meta->make_immutable(inline_constructor => 0);
     38 1;
     39