Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
[PATCH] added todo to Parrot::Test::PGE
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Dino Morelli  
View profile  
 More options Jun 11 2005, 11:56 am
Newsgroups: perl.perl6.internals
From: parrotbug-follo...@parrotcode.org (Dino Morelli)
Date: Sat, 11 Jun 2005 08:56:58 -0700
Local: Sat, Jun 11 2005 11:56 am
Subject: [perl #36247] [PATCH] added todo to Parrot::Test::PGE

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

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()

lib/Parrot/Test.pm
    SEE BELOW

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

*** to chromatic: ***
I had to make a change to Parrot::Test

Index: lib/Parrot/Test.pm
===================================================================
--- lib/Parrot/Test.pm  (revision 8301)
+++ lib/Parrot/Test.pm  (working copy)
@@ -430,7 +430,7 @@
             }

             # set a TODO for Test::Builder to find
-            my $call_pkg = $builder->exported_to();
+            my $call_pkg = $builder->exported_to() || '';
             local *{ $call_pkg . '::TODO' } = \$extra{todo}
                 if defined $extra{todo};
===================================================================

Without this change, this comes out of Parrot::Test when invoked from
Parrot::Test::PGE with todo args:

"Use of uninitialized value in concatenation (.) or string at
lib/Parrot/Test.pm line 434."

I looked at it for a while but am somewhat confused about why this
exported_to() is returning undef. I'm not sure this || '' was the way to
fix it and am asking you to weigh in on it.

Thanks for implementing the todo and thanks for taking a look at this
issue.

-Dino

--
 .~.    Dino Morelli
 /V\    email: dmore...@reactorweb.net
/( )\   weblog: http://categorically.net/d/blog/
^^-^^   preferred distro: Debian GNU/Linux  http://www.debian.org

[ Parrot-Test-PGE_pm.patch 1K ]
Index: lib/Parrot/Test/PGE.pm
===================================================================
--- lib/Parrot/Test/PGE.pm      (revision 8304)
+++ 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;

[ Parrot-Test_pm.patch < 1K ]
Index: lib/Parrot/Test.pm
===================================================================
--- lib/Parrot/Test.pm  (revision 8304)
+++ lib/Parrot/Test.pm  (working copy)
@@ -430,7 +430,7 @@
             }

             # set a TODO for Test::Builder to find
-            my $call_pkg = $builder->exported_to();
+            my $call_pkg = $builder->exported_to() || '';
             local *{ $call_pkg . '::TODO' } = \$extra{todo}
                 if defined $extra{todo};

[ p6rules-ws_t.patch < 1K ]
Index: t/p6rules/ws.t
===================================================================
--- t/p6rules/ws.t      (revision 8304)
+++ 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,9 +24,10 @@
 p6rule_isnt('foobar', ':w foo -? bar', 'basic ws non-match');

 # with :w not separated by a space
-# XXX: These forms of modifier separation do not yet work
-#p6rule_is  ('foo - bar', ':w()foo -? bar', 'basic ws match');
-#p6rule_is  ('foo - bar', ':w[]foo -? bar', 'basic ws match');
+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',


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »