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
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 via email to