Acme-FSM

 view release on metacpan or  search on metacpan

t/base/turn.t  view on Meta::CPAN

  qr.\Q{STOP}(tturn): action !isa defined .                          ],
 [        q|{STOP}{fturn} action isa undef|,
  [qw|                              fail |],
  [qw|                        STOP fturn |],
  qr.\Q{STOP}(fturn): action !isa defined .                          ],
 [ q|{CONTINUE}{eturn} action isa undef|,
  [qw|                     pass quiet |],
  [qw|                 CONTINUE eturn |],
  [ 4,                 [ q|SuliX|, '' ]]                             ],
 [ q|{CONTINUE}{uturn} action isa undef|,
  [qw|                     pass quiet |],
  [qw|                 CONTINUE uturn |],
  [ 4,                [ q|Endian|, '' ]]                             ],
 [ q|{CONTINUE}{tturn} action isa undef|,
  [qw|                     pass quiet |],
  [qw|                 CONTINUE tturn |],
  [ 4,          [ q|Caixa_M_gica|, '' ]]                             ],
 [ q|{CONTINUE}{fturn} action isa undef|,
  [qw|                     pass quiet |],
  [qw|                 CONTINUE fturn |],
  [ 4,                [ q|Macpup|, '' ]]                             ],
 [        q|{BREAK}{eturn} action isa undef|,
  [qw|                               fail |],
  [qw|                        BREAK eturn |],
  qr.\Q{BREAK}(eturn): action !isa defined .                         ],
 [        q|{BREAK}{uturn} action isa undef|,
  [qw|                               fail |],
  [qw|                        BREAK uturn |],
  qr.\Q{BREAK}(uturn): action !isa defined .                         ],
 [        q|{BREAK}{tturn} action isa undef|,
  [qw|                               fail |],
  [qw|                        BREAK tturn |],
  qr.\Q{BREAK}(tturn): action !isa defined .                         ],
 [        q|{BREAK}{fturn} action isa undef|,
  [qw|                               fail |],
  [qw|                        BREAK fturn |],
  qr.\Q{BREAK}(fturn): action !isa defined .                         ],
 [                                                               '',
  [qw|                                                      init |],
  { START    => { turns => { KNOPPIX => [ q|BackBox|,   undef ]}},
    STOP     => { turns => { Kiwi    => [ q|aLinux|,    undef ]}},
    CONTINUE => { turns => { Tuquito => [ q|EasyPeasy|, undef ]}},
    BREAK    => { turns => { DEFT    => [ q|CAELinux|,  undef ]}} }  ],
 [ q|{START}{turns} action isa undef|,
  [qw|                  pass quiet |],
  [qw|          START turn%KNOPPIX |],
  [ 4,            [ q|BackBox|, '' ]]                                ],
 [            q|{STOP}{turns} action isa undef|,
  [qw|                                  fail |],
  [qw|                        STOP turn%Kiwi |],
  qr.\Q{STOP}(turn%Kiwi): action !isa defined .                      ],
 [ q|{CONTINUE}{turns} action isa undef|,
  [qw|                     pass quiet |],
  [qw|          CONTINUE turn%Tuquito |],
  [ 4,             [ q|EasyPeasy|, '' ]]                             ],
 [            q|{BREAK}{turns} action isa undef|,
  [qw|                                   fail |],
  [qw|                        BREAK turn%DEFT |],
  qr.\Q{BREAK}(turn%DEFT): action !isa defined .                     ] );

plan tests => sum map                  {
    grep( $_ eq q|init|,  @$_ ) ? 0 :
    grep( $_ eq q|fail|,  @$_ ) ? 1 :
    grep( $_ eq q|quiet|, @$_ ) ? 1 : 2 }
                  map {         $_->[1] } @data;

foreach my $unit ( @data )                                           {
    if( grep $_ eq q|init|, @{$unit->[1]}    )                      {
        %st = %{$unit->[2]};
        AFSMTS_class_wrap { %opts }, \%st                            }
    elsif( grep $_ eq q|pass|, @{$unit->[1]} )                      {
        AFSMTS_method_wrap $method, @{$unit->[2]};
        is_deeply [ scalar keys %{$bb->{_}{fst}}, $rc ], $unit->[3],
          qq|$unit->[0], queried|;
        like $stderr, $unit->[4], qq|$unit->[0], noted|                 unless
          grep $_ eq q|quiet|, @{$unit->[1]}                         }
    elsif( grep $_ eq q|fail|, @{$unit->[1]} )                      {
        AFSMTS_method_wrap $method, @{$unit->[2]};
        like $@, $unit->[3], AFSMTS_croakson qq|$unit->[0], queried| }}

# vim: set filetype=perl



( run in 0.774 second using v1.01-cache-2.11-cpan-39bf76dae61 )