# New Ticket Created by  Dino Morelli 
# Please include the string:  [perl #36579]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=36579 >


This patch replaces the partially-committed ticket #36247, which can be closed.

I added support to Parrot::Test::PGE for chromatic's new todo feature of
the unit testing code.

files:

lib/Parrot/Test/PGE.pm
All three functions support the optional todo. p6rule_is(),
p6rule_isnt(), p6rule_like()

t/p6rules/ws.t
Uncommented existing future tests and added todo args to them.

-- 
  .~.    Dino Morelli
  /V\    email: [EMAIL PROTECTED]
/( )\   weblog: http://categorically.net/d/blog/
^^-^^   preferred distro: Debian GNU/Linux  http://www.debian.org
Index: lib/Parrot/Test/PGE.pm

===================================================================

--- lib/Parrot/Test/PGE.pm      (revision 8638)

+++ lib/Parrot/Test/PGE.pm      (working copy)

@@ -61,17 +61,20 @@

 =cut

 

 sub p6rule_is {

-    my ($target, $pattern, $description) = @_;

+    my ($target, $pattern, $description, @todo) = @_;

+

     if (ref $pattern) {

         Parrot::Test::pir_output_is(

             Parrot::Test::PGE::_generate_subrule_pir($target, $pattern),

             'matched',

-            $description);

+            $description,

+            @todo);

     } else {

         Parrot::Test::pir_output_is(

             Parrot::Test::PGE::_generate_pir_for($target, $pattern),

             'matched',

-            $description);

+            $description,

+            @todo);

     }

 }

 

@@ -83,17 +86,20 @@

 =cut

 

 sub p6rule_isnt {

-    my ($target, $pattern, $description) = @_;

+    my ($target, $pattern, $description, @todo) = @_;

+

     if (ref $pattern) {

         Parrot::Test::pir_output_is(

             Parrot::Test::PGE::_generate_subrule_pir($target, $pattern),

             'failed',

-            $description);

+            $description,

+            @todo);

     } else {

         Parrot::Test::pir_output_is(

             Parrot::Test::PGE::_generate_pir_for($target, $pattern),

             'failed',

-            $description);

+            $description,

+            @todo);

     }

 }

 

@@ -106,11 +112,12 @@

 =cut

 

 sub p6rule_like {

-    my ($target, $pattern, $expected, $description) = @_;

+    my ($target, $pattern, $expected, $description, @todo) = @_;

     Parrot::Test::pir_output_like(

             Parrot::Test::PGE::_generate_pir_for($target, $pattern, 1),

             $expected,

-            $description);

+            $description,

+            @todo);

 }

 

 package Parrot::Test::PGE;

Index: t/p6rules/ws.t

===================================================================

--- t/p6rules/ws.t      (revision 8638)

+++ t/p6rules/ws.t      (working copy)

@@ -1,6 +1,6 @@

 use strict;

 use warnings;

-use Parrot::Test tests => 19;

+use Parrot::Test tests => 21;

 use Parrot::Test::PGE;

 

 

@@ -24,10 +24,10 @@

 p6rule_isnt('foobar', ':w foo -? bar', 'basic ws non-match');

 

 # with :w not separated by a space

-# p6rule_is  ('foo - bar', ':w()foo -? bar', 'basic ws match',

-#     todo => 'words modifier () separation not implemented');

-# p6rule_is  ('foo - bar', ':w[]foo -? bar', 'basic ws match',

-#     todo => 'words modifier [] separation not implemented');

+p6rule_is  ('foo - bar', ':w()foo -? bar', 'basic ws match',

+    todo => 'words modifier () separation not implemented');

+p6rule_is  ('foo - bar', ':w[]foo -? bar', 'basic ws match',

+    todo => 'words modifier [] separation not implemented');

 p6rule_is  ('foo - bar', ':w\bfoo -? bar',

     'basic ws match with boundary modifier separation');

 p6rule_is  ('foo - bar', ':w::foo -? bar',

Reply via email to