Permalink
Browse files

pugs fudge

  • Loading branch information...
1 parent 77ec25f commit 5adcc30ba90446ab2828f3e6a2143f51263ab081 @coke coke committed Feb 19, 2012
View
@@ -35,6 +35,7 @@ plan 57;
is ~$ref, "a b c", '$arrayref = \@array works (1)';
# Explicit referentiation of arrays in assignment
#?niecza skip 'Cannot use value like Capture as a Number'
+ #?pugs todo
is +$ref, 1, '$arrayref = \@array works (2)';
}
@@ -43,6 +44,7 @@ plan 57;
my %hash = (a => 1, b => 2, c => 3);
my $ref = %hash;
+ #?pugs todo
is ~$ref.values.sort, "1 2 3", '$hashref = %hash works (1)';
is +$ref.values, 3, '$hashref = %hash works (2)';
}
@@ -52,7 +54,9 @@ plan 57;
my %hash = (a => 1, b => 2, c => 3);
my $ref = \%hash;
+ #?pugs todo
is ~$ref[0].values.sort, "1 2 3", '$hashref = \%hash works (1)';
+ #?pugs todo
is +$ref[0].values, 3, '$hashref = \%hash works (2)';
}
@@ -77,6 +81,7 @@ plan 57;
is ~@other, " a b c", '@other[$idx] = \@array works (1)';
is +@other, 2, '@other[$idx] = \@array works (2)';
#?niecza skip 'Cannot use value like Capture as a Number'
+ #?pugs todo
is +@other[1], 1, '@other[$idx] = \@array works (3)';
}
@@ -98,6 +103,7 @@ plan 57;
is +@other, 2, '@other[$idx] = \%hash works (1)';
#?niecza skip 'Cannot use value like Capture as a Number'
+ #?pugs todo
is +@other[1], 1, '@other[$idx] = \%hash works (2)';
}
@@ -119,6 +125,7 @@ plan 57;
is +%other, 1, '%other[$key] = \@array works (1)';
#?niecza skip 'Cannot use value like Capture as a Number'
+ #?pugs todo
is +%other<a>, 1, '%other[$key] = \@array works (2)';
}
@@ -140,6 +147,7 @@ plan 57;
is +%other, 1, '%other[$key] = \%hash works (1)';
#?niecza skip 'Cannot use value like Capture as a Number'
+ #?pugs todo
is +%other<a>, 1, '%other[$key] = \%hash works (2)';
}
@@ -160,6 +168,7 @@ plan 57;
#?niecza todo
is ~$pair.value, "a b c", '(key => \@array) works (1)';
#?niecza skip 'Cannot use value like Capture as a Number'
+ #?pugs todo
is +$pair.value, 1, '(key => \@array) works (2)';
}
@@ -168,6 +177,7 @@ plan 57;
my %hash = (a => 1, b => 2, c => 3);
my $pair = (key => %hash);
+ #?pugs todo
is ~$pair.value.values.sort, "1 2 3", '(key => %hash) works (1)';
is +$pair.value.values, 3, '(key => %hash) works (2)';
}
@@ -177,7 +187,9 @@ plan 57;
my %hash = (a => 1, b => 2, c => 3);
my $pair = (key => \%hash);
+ #?pugs todo
is ~$pair.value.[0].values.sort, "1 2 3", '(key => \%hash) works (1)';
+ #?pugs todo
is +$pair.value.[0].values, 3, '(key => \%hash) works (2)';
}
@@ -198,6 +210,7 @@ plan 57;
#?niecza todo
is ~$pair.value, "a b c", '(:key(\@array)) works (1)';
#?niecza skip 'Cannot use value like Capture as a Number'
+ #?pugs todo
is +$pair.value, 1, '(:key(\@array)) works (2)';
}
@@ -206,6 +219,7 @@ plan 57;
my %hash = (a => 1, b => 2, c => 3);
my $pair = (:key(%hash));
+ #?pugs todo
is ~$pair.value.values.sort, "1 2 3", '(:key(%hash)) works (1)';
is +$pair.value.values, 3, '(:key(%hash)) works (2)';
}
@@ -215,7 +229,9 @@ plan 57;
my %hash = (a => 1, b => 2, c => 3);
my $pair = (:key(\%hash));
+ #?pugs todo
is ~$pair.value.[0].values.sort, "1 2 3", '(:key(\%hash)) works (1)';
+ #?pugs todo
is +$pair.value.[0].values, 3, '(:key(\%hash)) works (2)';
}
View
@@ -22,6 +22,7 @@ my $bar = sub { return &?ROUTINE.name };
is($bar(), '<anon>', 'got the right routine name (anon-block)');
my $baz = try { &?ROUTINE.name };
+#?pugs todo
ok(not(defined $baz), '&?ROUTINE.name not defined outside of a routine');
# vim: ft=perl6
View
@@ -39,6 +39,7 @@ plan 38;
# $var unchanged, but assigning to $var doesn't modify @hash any
# longer; similarily, changing @hash[1] doesn't modify $var now
is $var, "e", "binding of hash elements works with .delete (2)";
+ #?pugs todo
is ~%hash.values.sort, "x z", "binding of hash elements works with .delete (3)";
$var = "f";
@@ -80,6 +81,7 @@ plan 38;
# $var unchanged, but assigning to $var doesn't modify @hash any
# longer; similarily, changing @hash[1] doesn't modify $var now
is $var, "e", "binding of hash elements works with rebinding the hash (2)";
+ #?pugs todo
is ~%hash.values.sort, "q s u",
"binding of hash elements works with rebinding the hash (3)";
@@ -98,6 +100,7 @@ plan 38;
foo %hash;
is $var, "new_value", "passing a hash to a sub expecting a hash behaves correctly (1)";
+ #?pugs todo
is ~%hash.values.sort, "new_value x z",
"passing a hash to a sub expecting a hash behaves correctly (2)";
}
@@ -112,6 +115,7 @@ plan 38;
foo %hash;
is $var, "new_value",
"passing a hash to a sub expecting a hashref behaves correctly (1)";
+ #?pugs todo
is ~%hash.values.sort, "new_value x z",
"passing a hash to a sub expecting a hashref behaves correctly (2)";
}
@@ -143,7 +147,9 @@ plan 38;
$var = "f";
# %hash<b> and $var are now "f", but %new_hash is unchanged.
is $var, "f", "hash assignment creates new containers (2)";
+ #?pugs todo
is ~%hash\ .values.sort, "f x z", "hash assignment creates new containers (3)";
+ #?pugs todo
is ~%new_hash.values.sort, "e x z", "hash assignment creates new containers (4)";
}
@@ -160,7 +166,9 @@ plan 38;
$var = "f";
# %hash<b> and $var are now "f", but %new_hash is unchanged.
is $var, "f", "hash binding does not create new containers (2)";
+ #?pugs todo
is ~%hash\ .values.sort, "f x z", "hash binding does not create new containers (3)";
+ #?pugs todo
is ~%new_hash.values.sort, "f x z", "hash binding does not create new containers (4)";
}
@@ -180,6 +188,7 @@ plan 38;
is ~%hash\ .values.sort, "a c", 'binding %hash := $hashref works (3)';
}
+#?pugs todo
eval_dies_ok 'my %h = a => 1, b => 2; %h<a b> := (4, 5)',
'Cannot bind to hash slices';
@@ -9,9 +9,11 @@ plan 12;
ok !((1 + 2i) !~~ (1 + 2i)), 'Complex !~~ Complex (-)';
ok (1 + 2i) !~~ (1 + 1i), 'Complex !~~ Complex (+)';
ok (1 + 2i) !~~ (2 + 2i), 'Complex !~~ Complex (+)';
+ #?pugs todo
ok 3 ~~ (3 + 0i), 'Num ~~ Complex (+)';
ok !(2 ~~ (3 + 0i)), 'Num ~~ Complex (-)';
ok !(3 ~~ (3 + 1i)), 'Num ~~ Complex (-)';
+ #?pugs todo
ok !(3 !~~ (3 + 0i)), 'Num !~~ Complex (-)';
ok (2 !~~ (3 + 0i)), 'Num !~~ Complex (+)';
ok (3 !~~ (3 + 1i)), 'Num !~~ Complex (+)';
@@ -14,51 +14,67 @@ plan 36;
ok(([1] ~~ [1]), "array smartmatch boundary conditions");
#?rakudo todo 'nom regression'
#?niecza todo
+ #?pugs todo
ok((1,2,3,4) ~~ (1,*), 'array smartmatch dwims * at end');
#?rakudo todo 'nom regression'
#?niecza todo
+ #?pugs todo
ok((1,2,3,4) ~~ (1,*,*), 'array smartmatch dwims * at end (many *s)');
#?rakudo todo 'nom regression'
#?niecza todo
+ #?pugs todo
ok((1,2,3,4) ~~ (*,4), 'array smartmatch dwims * at start');
#?rakudo todo 'nom regression'
#?niecza todo
+ #?pugs todo
ok((1,2,3,4) ~~ (*,*,4), 'array smartmatch dwims * at start (many *s)');
#?rakudo todo 'nom regression'
#?niecza todo
+ #?pugs todo
ok((1,2,3,4) ~~ (1,*,3,4), 'array smartmatch dwims * 1 elem');
#?rakudo todo 'nom regression'
#?niecza todo
+ #?pugs todo
ok((1,2,3,4) ~~ (1,*,*,3,4), 'array smartmatch dwims * 1 elem (many *s)');
#?rakudo todo 'nom regression'
#?niecza todo
+ #?pugs todo
ok((1,2,3,4) ~~ (1,*,4), 'array smartmatch dwims * many elems');
#?rakudo todo 'nom regression'
#?niecza todo
+ #?pugs todo
ok((1,2,3,4) ~~ (1,*,*,4), 'array smartmatch dwims * many elems (many *s)');
#?rakudo todo 'nom regression'
#?niecza todo
+ #?pugs todo
ok((1,2,3,4) ~~ (*,3,*), 'array smartmatch dwims * at start and end');
#?rakudo todo 'nom regression'
#?niecza todo
+ #?pugs todo
ok((1,2,3,4) ~~ (*,*,3,*,*), 'array smartmatch dwims * at start and end (many *s)');
#?rakudo todo 'nom regression'
#?niecza todo
+ #?pugs todo
ok((1,2,3,4) ~~ (*,1,2,3,4), 'array smartmatch dwims * can match nothing at start');
#?rakudo todo 'nom regression'
#?niecza todo
+ #?pugs todo
ok((1,2,3,4) ~~ (*,*,1,2,3,4), 'array smartmatch dwims * can match nothing at start (many *s)');
#?rakudo todo 'nom regression'
#?niecza todo
+ #?pugs todo
ok((1,2,3,4) ~~ (1,2,*,3,4), 'array smartmatch dwims * can match nothing in middle');
#?rakudo todo 'nom regression'
#?niecza todo
+ #?pugs todo
ok((1,2,3,4) ~~ (1,2,*,*,3,4), 'array smartmatch dwims * can match nothing in middle (many *s)');
#?rakudo todo 'nom regression'
#?niecza todo
+ #?pugs todo
ok((1,2,3,4) ~~ (1,2,3,4,*), 'array smartmatch dwims * can match nothing at end');
#?rakudo todo 'nom regression'
#?niecza todo
+ #?pugs todo
ok((1,2,3,4) ~~ (1,2,3,4,*,*), 'array smartmatch dwims * can match nothing at end (many *s)');
ok(!((1,2,3,4) ~~ (1,*,3)), '* dwimming does not cause craziness');
ok(!((1,2,3,4) ~~ (*,5)), '* dwimming does not cause craziness');
@@ -74,11 +90,13 @@ plan 36;
ok (@b !~~ @a), 'Basic smartmatching on arrays (negative)';
#?rakudo todo 'nom regression'
#?niecza todo
+ #?pugs todo
ok (@a ~~ @m), 'Whatever dwimminess in arrays';
ok (@a ~~ (1, 2, 3)), 'smartmatch Array ~~ List';
ok ((1, 2, 3) ~~ @a), 'smartmatch List ~~ Array';
#?rakudo todo 'nom regression'
#?niecza todo
+ #?pugs todo
ok ((1, 2, 3) ~~ @m), 'smartmatch List ~~ Array with dwim';
ok (1 ~~ *,1,*), 'smartmatch with Array RHS co-erces LHS to list';
View
@@ -17,6 +17,7 @@ plan 7;
is foo($bar), 19, "calling a sub with an is rw param";
is $bar, 42, "sub changed our variable";
# RT #74830
+ #?pugs todo
dies_ok { eval('foo(28)') }, 'is rw requires a variable';
}
View
@@ -47,7 +47,9 @@ is(Test3::pkg, ::Test3::, 'eval\'ed package $?PACKAGE');
cmp_ok(Test3::pkg, &infix:<===>, ::Test3::, 'eval\'ed package type object');
# this one came from t/packages/Test.pm
+#?pugs todo
is(t::spec::packages::PackageTest::ns, "t::packages::PackageTest", "loaded package");
+#?pugs todo
cmp_ok(t::spec::packages::PackageTest::pkg, &infix:<===>, ::t::packages::PackageTest::, 'loaded package $?PACKAGE object');
my $x;
lives_ok { $x = test_export() }, "export was imported successfully";
@@ -19,12 +19,14 @@ multi sub doit_sub(Int $x) { 2 * $x };
multi sub doit_sub(Int $x) is default { 3 * $x };
lives_ok { doit_sub(3) }, "'is default' trait makes otherwise ambiguous method dispatch live";
+#?pugs todo
is doit_sub(3), 9, "'is default' trait on subs";
multi sub slurpy() is default { return 'a' };
multi sub slurpy(*@args) { return 'b' }; #OK not used
is slurpy(2), 'b', 'basic sanity with arity based dispatch and slurpies';
+#?pugs todo
is slurpy(), 'a', '"is default" trait wins against empty slurpy param';
# vim: ft=perl6
View
@@ -22,6 +22,7 @@ plan 11;
#?rakudo skip 'unspecced'
#?niecza todo
+#?pugs todo
{
my $a;
dies_ok { $a.elems }, ".elems does not work on arbitrary scalars (1)";
View
@@ -18,6 +18,7 @@ my $PI = 3.141592e0;
is_approx(eval("pi"), $PI, "pi imported by default");
+#?pugs todo
eval_dies_ok("3 + pi()", "pi() is not a sub");
is_approx(eval("3 + pi"), $PI+3, "3+pi, as a bareword");
Oops, something went wrong.

0 comments on commit 5adcc30

Please sign in to comment.