Permalink
Browse files

pugs fudge

  • Loading branch information...
1 parent 6ee7d4a commit d4cb58cef0a2e248f8f74289ff19433eafb18917 @coke coke committed Feb 25, 2012
@@ -109,10 +109,12 @@ is((do { my $दूसरा = 2; sub टोटल ($x) { $x + 2 }; टोटल
# L<S02/Unicode Semantics/Perl can count Unicode line and paragraph separators>
#?rakudo: todo 'PS does not work to separate lines'
+#?pugs skip "eval_lives_ok"
eval_lives_ok "\{ 1 \} \x2029 \{ 1 \}", "Unicode 2029 can terminate lines";
# L<S02/Bracketing Characters/If a character is already used>
+#?pugs 6 skip "eval_lives_ok"
eval_lives_ok "q\x298d test \x298e", "Unicode open-298d maps to close-298e";
eval_lives_ok "q\x301d test \x301e", "Unicode open-301d maps to close-301e";
eval_dies_ok "q\x301d test \x301f", "Unicode open-301d does not map to close-301f";
@@ -97,6 +97,7 @@ plan 37;
{
#?rakudo todo 'nom regression'
#?niecza todo
+ #?pugs todo
nok foo().defined, "get variable not yet declared using a sub (1)";
is foo(), 1, "get variable not yet declared using a sub (2)";
is foo(), 2, "get variable not yet declared using a sub (3)";
@@ -108,6 +109,7 @@ plan 37;
{
#?rakudo todo 'nom regression'
#?niecza todo
+ #?pugs todo
nok bar().defined, "runtime part of my not yet executed (1)";
is bar(), 1, "runtime part of my not yet executed (2)";
is bar(), 2, "runtime part of my not yet executed (3)";
@@ -144,6 +146,7 @@ plan 37;
#?rakudo todo 'nom regression'
#?niecza todo
+ #?pugs todo
nok rmbl().defined, "var captured by sub is the right var (1)";
$a++;
is rmbl(), 2, "var captured by sub is the right var (2)";
View
@@ -71,7 +71,6 @@ plan 18;
}
$_ = 23;
- #?pugs todo 'bug'
is bar(), 42, '$_ is implicitly declared "is dynamic" (2)';
}
@@ -85,6 +84,7 @@ plan 18;
my $abs = 23;
#?niecza todo 'strictness'
+ #?pugs todo
dies_ok { bar() },
'vars not declared "is dynamic" are not accessible via $CALLER::';
}
@@ -113,13 +113,13 @@ plan 18;
my sub modify { $CALLER::_++ }
$_ = 42;
lives_ok { modify() }, '$_ is implicitly rw (1)';
+ #?pugs todo
is $_, 43, '$_ is implicitly rw (2)';
}
{
my sub modify { $CALLER::foo++ }
my $foo is dynamic = 42;
- #?pugs 2 todo 'bug'
lives_ok { modify() },
'"is dynamic" vars declared "is rw" are rw when accessed with $CALLER:: (1)';
is $foo, 43,
@@ -130,6 +130,7 @@ plan 18;
my sub get_foo { try { $DYNAMIC::foo } }
my $foo is dynamic = 42;
+ #?pugs todo
is get_foo(), 42, '$DYNAMIC:: searches call stack';
}
@@ -139,11 +140,9 @@ plan 18;
my sub rebind_foo { $CALLER::foo := $other_var }
my $foo is dynamic = 42;
- #?pugs 2 todo 'bug'
lives_ok { rebind_foo() }, 'rebinding $CALLER:: variables works (1)';
is $foo, 23, 'rebinding $CALLER:: variables works (2)';
$other_var++;
- #?pugs todo 'bug'
is $foo, 24, 'rebinding $CALLER:: variables works (3)';
}
@@ -52,6 +52,7 @@ plan 21;
my $defined;
try { $defined = defined @array[*-5]; }
+ #?pugs todo
ok !$defined,
'defined @array[$negative_index_out_of_bounds] should be false';
is +@array, 4,
@@ -103,6 +104,7 @@ plan 21;
is $n, 1, 'grep on extended array';
@a[1] = 'c'; # cmp doesn't handle Mu cmp Mu yet
#?niecza todo 'min on list with undefined el ignores it'
+ #?pugs todo
is @a.min(), 'b', 'min on list with undefined el ignores it';
}
View
@@ -9,6 +9,7 @@ plan 33;
is(@array.elems, 5, 'array has 5 elements');
is(@array[0], 11, 'first value is 11');
+ #?pugs todo
is(@array[*-1], 15, 'last value is 15');
# 3[0] etc. should *not* work, but (3,)[0] should.
# That's similar as with the .kv issue we've had: 3.kv should fail, but
@@ -21,6 +22,7 @@ plan 33;
is(@array[0].elems, 5, 'arrayref has 5 elements');
is(@array[0][0], 11, 'first element in arrayref is 11');
+ #?pugs todo
is(@array[0][*-1], 15, 'last element in arrayref is 15');
}
@@ -30,19 +32,26 @@ plan 33;
is(@array[0].elems, 5, 'first arrayref has 5 elements');
is(@array[1].elems, 5, 'second arrayref has 5 elements');
is(@array[0][0], 11, 'first element in first arrayref is 11');
+ #?pugs todo
is(@array[0][*-1], 15, 'last element in first arrayref is 15');
is(@array[1][0], 21, 'first element in second arrayref is 21');
+ #?pugs todo
is(@array[1][*-1], 25, 'last element in second arrayref is 25');
+ #?pugs todo
is(@array[*-1][0], 31, 'first element in last arrayref is 31');
+ #?pugs todo
is(@array[*-1][*-1], 35, 'last element in last arrayref is 35');
}
{
my %hash = (k1 => [ 11 .. 15 ]);
+ #?pugs todo
is(%hash<k1>.elems, 5, 'k1 has 5 elements');
is(%hash<k1>[0], 11, 'first element in k1 is 11');
+ #?pugs todo
is(%hash<k1>[*-1], 15, 'last element in k1 is 15');
+ #?pugs todo
nok(%hash<12>.defined, 'nothing at key "12"');
}
@@ -52,8 +61,10 @@ plan 33;
is(%hash<k1>.elems, 5, 'k1 has 5 elements');
is(%hash<k2>.elems, 5, 'k2 has 5 elements');
is(%hash<k1>[0], 11, 'first element in k1 is 11');
+ #?pugs todo
is(%hash<k1>[*-1], 15, 'last element in k1 is 15');
is(%hash<k2>[0], 21, 'first element in k1 is 21');
+ #?pugs todo
is(%hash<k2>[*-1], 25, 'last element in k1 is 25');
nok(%hash<12>.defined, 'nothing at key "12"');
nok(%hash<22>.defined, 'nothing at key "22"');
View
@@ -131,19 +131,19 @@ eval_dies_ok '0 := 1', 'cannot bind to a literal';
# := actually takes subroutine parameter list
#?rakudo skip 'List binding'
#?niecza skip 'list binding'
+#?pugs skip 'Cannot bind this as lhs'
{
my $a;
:(:$a) := (:a<foo>);
- #?pugs todo
is($a, "foo", "bound keyword");
my @tail;
:($a, *@tail) := (1, 2, 3);
- #?pugs todo
ok($a == 1 && ~@tail eq '2 3', 'bound slurpy');
}
# RT #77462
# binding how has the same precedence as list assignment
+#?pugs todo
{
my $x := 1, 2;
is $x.join, '12', 'binding has same precdence as list assignment'
@@ -81,6 +81,7 @@ is(%z{0}, $base, '%z{0}');
my $x;
$x = "123.456";
+ #?pugs todo
is( ++$x, "124.456", "'123.456'++ is '124.456' (NOT 123.457)" );
$x = "124.456";
is( --$x, "123.456", "'124.456'-- is '123.456'" );
@@ -90,8 +91,10 @@ is(%z{0}, $base, '%z{0}');
my $x;
$x = "/tmp/pix000.jpg";
+ #?pugs todo
is( ++$x, "/tmp/pix001.jpg", "'/tmp/pix000.jpg'++ is '/tmp/pix001.jpg'" );
$x = "/tmp/pix001.jpg";
+ #?pugs todo
is( --$x, "/tmp/pix000.jpg", "'/tmp/pix001.jpg'-- is '/tmp/pix000.jpg'" );
}
@@ -102,16 +105,19 @@ is(%z{0}, $base, '%z{0}');
$x = "zi";
is( ++$x, "zj", "'zi'++ is 'zj'" );
$x = "zj";
+ #?pugs todo
is( --$x, "zi", "'zj'-- is 'zi'" );
$x = "zr";
# EBCDIC check (r and s not contiguous)
is( ++$x, "zs", "'zr'++ is 'zs'" );
$x = "zs";
+ #?pugs todo
is( --$x, "zr", "'zs'-- is 'zr'" );
}
#?niecza skip "Failure NYI"
+#?pugs skip "Failure NYI"
{
my $foo;
@@ -127,12 +133,14 @@ is(%z{0}, $base, '%z{0}');
$foo = "\x[3a1]";
#?rakudo todo 'weird ranges'
+ #?pugs todo 'weird ranges'
is( ++$foo, "\x[3a3]", 'there is no \\x[3a2]' );
}
{
my $foo = "K\x[3c9]";
#?rakudo todo 'weird ranges'
+ #?pugs todo 'weird ranges'
is( ++$foo, "L\x[3b1]", "increment 'K\x[3c9]'" );
}
@@ -145,6 +153,8 @@ is(%z{0}, $base, '%z{0}');
is $y, 1, 'Can autoincrement a Mu variable (postfix)';
}
+#?pugs skip "todo"
+#?DOES 2
{
class Incrementor {
has $.value;
@@ -161,6 +171,8 @@ is(%z{0}, $base, '%z{0}');
is $o.value, 84, 'Overriding succ catches prefix increment';
}
+#?pugs skip "todo"
+#?DOES 2
{
class Decrementor {
has $.value;
@@ -177,6 +189,8 @@ is(%z{0}, $base, '%z{0}');
is $o.value, 16, 'Overriding pred catches prefix decrement';
}
+#?pugs skip "todo"
+#?DOES 6
{
# L<S03/Autoincrement precedence/Increment of a>
@@ -45,34 +45,39 @@ plan 23;
is $s, 'ab', 'my $s; $s ~= "ab" works'
}
+#?pugs todo
{
my Str $s;
$s ~= 'ab';
is $s, 'ab', 'my Str $s; $s ~= "ab" works'
}
#?niecza todo
+#?pugs todo
{
my $x;
$x *= 2;
ok $x == 2, 'my $x; $x *= 2 works'
}
#?niecza todo
+#?pugs todo
{
my $x;
$x **= 2;
ok $x == 1, 'my $x; $x **= 2 works'
}
#?niecza todo
+#?pugs todo
{
my Int $x;
$x *= 2;
ok $x == 2, 'my Int $x; $x *= 2 works'
}
#?niecza todo
+#?pugs todo
{
my Int $x;
$x **= 2;
@@ -97,6 +102,7 @@ plan 23;
}
#?niecza todo
+#?pugs todo
{
my $x;
$x *= 1i;
@@ -106,6 +112,7 @@ plan 23;
# L<S03/Assignment operators/"If you apply an assignment operator to a
# container">
#?niecza todo
+#?pugs todo
{
# yes, this is serious. It's in the specs ;-)
my Int $x;
@@ -114,19 +121,22 @@ plan 23;
}
#?niecza todo
+#?pugs todo
{
my $x;
$x *= 5;
is $x, 5, '*= autovivifies with correct neutral element (without type constraint)';
}
#?niecza todo
+#?pugs todo
{
my Int %h;
is (%h<foo> *= 23), 23, '*= autovivifies with correct neutral element (with Int proto on hash items)';
}
#?niecza todo
+#?pugs todo
{
my %h;
is (%h<foo> *= 23), 23, '*= autovivifies with correct neutral element (without proto on hash items)';
View
@@ -41,6 +41,7 @@ plan 53;
ok (\@a eqv \@a), "eqv on array references (1)";
ok (\@b eqv \@b), "eqv on array references (2)";
+ #?pugs todo
ok !(\@a eqv \@b), "eqv on array references (3)";
@a := @b;
ok \@a eqv \@b, '\@array of two bound arrays are eqv';
@@ -55,6 +56,7 @@ plan 53;
ok ($b eqv $b), "eqv on scalar references (1-2)";
ok ($a eqv $b), "eqv on scalar references (1-3)";
#?rakudo skip 'infix:<!eqv>'
+ #?pugs todo
ok (\$a !eqv \$b), "eqv on scalar references (1-4)";
}
@@ -99,17 +101,20 @@ plan 53;
{
#?niecza todo
ok !({a => 1} eqv {a => 2}), "eqv on anonymous hash references (-)";
+ #?pugs todo
ok ({a => 1} eqv {a => 1}), "eqv on anonymous hash references (+)";
+ #?pugs todo
ok ({a => 2, b => 1} eqv { b => 1, a => 2}), 'order really does not matter';
ok !({a => 1} eqv {a => 1, b => 2}), 'hashes: different number of pairs';
}
#?rakudo skip 'captures'
#?niecza skip 'Cannot use value like Capture as a number'
+#?pugs skip "Mu"
+#?DOES 3
{
ok !(\3 eqv \4), "eqv on anonymous scalar references (1)";
# XXX the following seems bogus nowadays
- #?pugs 2 todo 'bug'
ok !(\3 eqv \3), "eqv on anonymous scalar references (2)";
ok !(\Mu eqv \Mu), "eqv on anonymous scalar references (3)";
}
@@ -139,6 +144,8 @@ plan 53;
is(0 eqv 1, Bool::False, 'eqv returns Bool::False when false');
}
+#?pugs skip "Mu"
+#?DOES 3
{
#?niecza skip 'Nominal type check failed in binding $a in CORE infix:<eqv>'
is Mu eqv Mu, Bool::True, 'Mu eqv Mu';
@@ -149,7 +156,7 @@ plan 53;
# RT #75322 - Rakudo used to be confused when lists began with ()
{
- #?niecza todo
+ #?niecza todo
nok ((), "x") eqv ((), 9), 'list starting with () - 1';
nok ((), (), 1) eqv ((), 9), 'list starting with () - 1';
nok ((), (), (), 1) eqv ((), (), ""), 'list starting with () - 1';
Oops, something went wrong.

0 comments on commit d4cb58c

Please sign in to comment.