Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
spurious successes in t/base/given.t
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
  2 messages - 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
 
Garrett Rooney  
View profile  
 More options Mar 4 2005, 8:55 pm
Newsgroups: perl.perl6.compiler
From: roo...@electricjellyfish.net (Garrett Rooney)
Date: Fri, 04 Mar 2005 20:55:58 -0500
Local: Fri, Mar 4 2005 8:55 pm
Subject: [pugs] spurious successes in t/base/given.t

There are two unexpected successes in given.t (it must be my night for
finding things with that file...), but unfortunately they're not because
pugs is magically doing the right thing, they're because it's doing the
wrong thing in a way that exactly matches what the test is looking for,
if you get my meaning.

When the code

$expected = ($digit eq "T") ?? 10 :: 11;

is executed the second time through $expected is getting set to '', not
10 or 11.  This means that later on the todo_ok tests succeed because
the results are (incorrectly) getting set to ''.  Actually, the first
time through it's also wrong, $expected gets set to 1, which isn't right
either, it just doesn't show up as an unexpected success because the
results aren't 1.

The following patch alters the test to something that works with the
current version of pugs, although if we want to truly copy the example
from apoc 4 it should probably go back once the problem is fixed.

-garrett

[ given-todo-spurious.diff < 1K ]
Index: t/base/given.t
===================================================================
--- t/base/given.t      (revision 564)
+++ t/base/given.t      (working copy)
@@ -61,7 +61,12 @@
                my $expected;

                if ($digit eq ( "T" | "E" )){
-                       $expected = ($digit eq "T") ?? 10 :: 11;
+                       # $expected = ($digit eq "T") ?? 10 :: 11;
+                       if $digit eq "T" {
+                               $expected = 10;
+                       } else {
+                               $expected = 11;
+                       }
                } else {
                        $expected = $digit;
                }


    Reply to author    Forward  
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.
Luke Palmer  
View profile  
 More options Mar 4 2005, 9:07 pm
Newsgroups: perl.perl6.compiler
From: l...@luqui.org (Luke Palmer)
Date: Fri, 4 Mar 2005 19:07:44 -0700
Local: Fri, Mar 4 2005 9:07 pm
Subject: Re: [pugs] spurious successes in t/base/given.t

Garrett Rooney writes:
> There are two unexpected successes in given.t (it must be my night for
> finding things with that file...), but unfortunately they're not because
> pugs is magically doing the right thing, they're because it's doing the
> wrong thing in a way that exactly matches what the test is looking for,
> if you get my meaning.

Thanks, applied.

Luke


    Reply to author    Forward  
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 »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google