Acme-FSM

 view release on metacpan or  search on metacpan

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

my %plug = ( diag_level => 5 );
my $switch;

my @data =
([            q|{switch} isa (undef)|,
  [qw|                        fail |],
  sub {                  undef, { } },
  [                                 ],
  qr.\Q {START}{switch} !isa defined.                                 ],
 [                                           q|{switch} isa (SCALAR)|,
  [qw|                                                  fail noise |],
  sub {                                               \$method, { } },
  [                                                                 ],
                                                  qr.\Q isa (SCALAR)., 
  { noted => qr.(?m)\Q[query_switch]: {START}{switch} isa (SCALAR). } ],
 [                                    q|{switch} isa (Acme::FSM)|,
  [qw|                                         copy fail noise |],
  sub {                                                $bb, { } },
  [                                                             ],
                                           qr.\Q isa (Acme::FSM).,
  { noted =>
      qr.(?m)\Q[query_switch]: {START}{switch} isa (Acme::FSM). }     ],
 [  q|{switch} isa (CODE), {namespace} unset, returns TRUE, no arg|,
  [qw|                                                pass noise |],
  sub {                                      push_push( !0 ), { } },
  [                                                               ],
  sub {                       $bb->{RCS}, exists $bb->{CSSC}, $rc },
  [                                      q|m_files|, '', q|tturn| ],
  { noted => qr.(?m)\Q[query_switch]: {START}{switch} isa (CODE). }   ],
 [     q|{switch} isa (CODE), {namespace} unset, returns TRUE, arg|,
  [qw|                                                pass noise |],
  sub {                                                undef, { } },
  [qw|                                                   Civetta |],
  sub {                                @$bb{qw| RCS CSSC |}, @$rc },
  [qw|                       archipel Civetta tturn superversion |],
  { noted => qr.(?m)\Q[query_switch]: {START}{switch} isa (CODE). }   ],
 [ q|{switch} isa (CODE), {namespace} unset, returns FALSE, no arg|,
  [qw|                                                pass noise |],
  sub {                                      push_push( !1 ), { } },
  [                                                               ],
  sub {                       $bb->{RCS}, exists $bb->{CSSC}, $rc },
  [                                    q|mercurial|, '', q|fturn| ],
  { noted => qr.(?m)\Q[query_switch]: {START}{switch} isa (CODE). }   ],
 [    q|{switch} isa (CODE), {namespace} unset, returns FALSE, arg|,
  [qw|                                                pass noise |],
  sub {                                                undef, { } },
  [qw|                                                      Onda |],
  sub {                                @$bb{qw| RCS CSSC |}, @$rc },
  [qw|                             surround_SCM Onda fturn asvcs |],
  { noted => qr.(?m)\Q[query_switch]: {START}{switch} isa (CODE). }   ],
 [                      q|{switch} isa (CODE), {namespace} isa set|,
  [qw|                                                pass noise |],
  sub {                push_push( !0 ), { namespace => q|vesta| } },
  [                                                               ],
  sub {                       $bb->{RCS}, exists $bb->{CSSC}, $rc },
  [                                         q|dcvs|, '', q|tturn| ],
  { noted => qr.(?m)\Q[query_switch]: {START}{switch} isa (CODE). }   ],
 [    q|{switch} isa (CODE), {namespace} isa set, argument isa set|,
  [qw|                                                pass noise |],
  sub {                          undef, { namespace => q|vesta| } },
  [qw|                          allfusion_harvest_change_manager |],
  sub {                                @$bb{qw| RCS CSSC |}, @$rc },
  [qw|        so6 allfusion_harvest_change_manager tturn fastcst |],
  { noted => qr.(?m)\Q[query_switch]: {START}{switch} isa (CODE). }   ],
 [                 q|{switch} isa (), {namespace} !isa defined|,
  [qw|                                            fail noise |],
  sub {                                    q|snapshotcm|, { } },
  [                                                           ],
                                qr.\Q {namespace} !isa defined.,
  { noted => qr.(?m)\Q[query_switch]: {START}{switch} isa (). },      ],
 [    q|{switch} !isa defined method, {namespace} eq ()|,
  [qw|                               fail noise noise |],
  sub                                                 {
      $t::TestSuite::class_cheat = q|t::TestSuite::FSM|;
                     q|hsup_hsup|, { namespace => '' } },
  [                                                    ],
    qr.\Q <t::TestSuite::FSM> can't [hsup_hsup] method .,
  { defaulting =>        qr.(?xm)\[query_switch\]:\s
      defaulting\s\{START\}\{switch\}\sto\s\x24self.,
    defaulted  =>        qr.(?xm)\[query_switch\]:\s
           \{namespace\}\sisa\s\(t::TestSuite::FSM\).  }              ],
 [    q|{switch} isa defined method, {namespace} eq ()|,
  [qw|                                    pass noise |],
  sub {             q|push_push|, { namespace => '' } },
  [                                                   ],
  sub {         $bb->{MKS}, exists $bb->{CS_RCS}, $rc },
  [                              q|arx|, '', q|tturn| ],
  { noted =>             qr.(?xm)\[query_switch\]:\s
      going\sfor\s<t::TestSuite::FSM>->\[push_push\]. }               ],
 [q|{switch} isa defined method, {namespace} eq (), argument is set|,
  [qw|                                                 pass noise |],
  sub {                                 undef, { namespace => '' } },
  [qw|                                                      darcs |],
  sub {                               @$bb{qw| MKS CS_RCS |}, @$rc },
  [qw|                           cvsnt darcs tturn sourceanywhere |],
  { noted =>             qr.(?xm)\[query_switch\]:\s
      going\sfor\s<t::TestSuite::FSM>->\[push_push\].              }  ],
 [                      q|{switch} !isa defined method, | .
                q|{namespace} isa (t::TestSuite::switch)|,
  [qw|                                fail noise noise |],
  sub {
      $switch = t::TestSuite::switch->new;
      undef $t::TestSuite::class_cheat;
                 q|hsup_hsup|, { namespace => $switch } },
  [                                                     ],
  qr.\Q <t::TestSuite::switch> can't [hsup_hsup] method .,
  { -misdefaulting =>  qr.(?xm)\[query_switch\]:\s
              defaulting\s\{switch\}\sto\s\x24self.,
    noted          =>  qr.(?xm)\[query_switch\]:\s
      \{namespace\}\sisa\s\(t::TestSuite::switch\).     }             ],
 [                        q|{switch} isa defined method, | .
                 q|{namespace} isa (t::TestSuite::switch)|,
  [qw|                                       pass noise |],
  sub {           q|push_push|, { namespace => $switch } },
  [                                                      ],
  sub {
      $switch->{jedi_vcs}, exists $switch->{gat}, exists $bb->{MKS},
        $rc                                              },
  [                          q|opencm|, '', '', q|tturn| ],
  { noted =>                qr.(?xm)\[query_switch\]:\s
      going\sfor\s<t::TestSuite::switch>->\[push_push\]. }            ],
 [                             q|{switch} isa defined method, | .
     q|{namespace} isa (t::TestSuite::switch), argument is set|,



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