Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
pugs fudge
  • Loading branch information
coke committed Apr 16, 2012
1 parent f954d29 commit fa12fff
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions S03-operators/identity.t
Expand Up @@ -133,6 +133,7 @@ class TestObj { has $!a }

#?rakudo todo 'misuse of =:='
#?niecza skip 'Failure NYI'
#?pugs skip 'Failure NYI'
{
ok (Mu =:= Mu) ~~ Failure, 'misuse of =:= is failure (Mu)';
ok (1 =:= '1') ~~ Failure, 'misuse of =:= is failure (literals)';
Expand Down
6 changes: 5 additions & 1 deletion S04-statements/try.t
Expand Up @@ -6,6 +6,7 @@ use Test;

plan 24;

#?pugs todo
{
# simple try
my $lived = Mu;
Expand Down Expand Up @@ -87,7 +88,7 @@ plan 24;
is argcount( try { 17 }, 23, 99 ), 3, 'try gets a block, nothing more';
}


#?pugs todo
{
my $catches = 0;
try {
Expand All @@ -102,6 +103,7 @@ plan 24;
}

# RT #68728
#?pugs todo
{
my $str = '';
try {
Expand All @@ -120,6 +122,7 @@ plan 24;
}

#?niecza skip 'new exception stuff'
#?pugs skip '{obj:MyPayload}'
{
class MyPayload {
method Str() { 'something exceptional' }
Expand All @@ -140,6 +143,7 @@ plan 24;

# RT #111704
#?rakudo todo 'RT 111704'
#?pugs skip 'Missing required parameters: $_'
{
my $x = 0;
try { $x = $_ } given '42';
Expand Down
6 changes: 6 additions & 0 deletions S06-signature/optional.t
Expand Up @@ -37,8 +37,10 @@ is opt_typed() , 'undef', 'can leave out optional typed param';

# L<S06/Parameters and arguments/"required positional parameters must come
# before those bound to optional positional">
#?pugs todo
eval_dies_ok 'sub wrong1 ($a?, $b) {...}', 'optional params before required ones are forbidden';
# RT #76022
#?pugs todo
{
eval_dies_ok 'sub wrong2 ($a = 1, $b) {...}', "...even if they're only optional by virtue of a default";
eval_dies_ok 'sub wrong3 ($a = 0, $b) {...}', '...and the default is 0';
Expand Down Expand Up @@ -66,6 +68,7 @@ dies_ok {foo_53814(1,Mu,'something_extra',:y(3))},
rt54804( 1, , 3, )/, "two commas in a row doesn't parse";
}

#?pugs todo
eval_dies_ok( 'sub rt66822($opt?, $req) { "$opt, $req" }',
"Can't put required parameter after optional parameters" );

Expand All @@ -80,10 +83,12 @@ is opt_hash1(), 0, "optional hash not passed is empty";
is opt_hash2(), 0, "optional hash not passed is empty (copy)";

# RT #71110
#?pugs todo
eval_dies_ok 'sub opt($a = 1, $b) { }',
'Cannot put required parameter after optional parameters';

# RT #74758
#?pugs todo
{
sub opt-type1(Int $x?) { $x };
ok opt-type1() === Int,
Expand All @@ -93,6 +98,7 @@ eval_dies_ok 'sub opt($a = 1, $b) { }',
}

# RT # 76728
#?pugs skip "Can't modify constant item: VUndef"
{
sub opt-hash(%h?) {
%h<a> = 'b';
Expand Down
11 changes: 11 additions & 0 deletions S32-array/delete.t
Expand Up @@ -25,27 +25,35 @@ sub make-string(@a) {

is ~@array.delete(0, 3), "a d",
"deletion of array elements returned the right things";
#?pugs todo
is make-string(@array), "Any() b", "deletion of array elements (1)";
#?pugs todo
is +@array, 2, "deletion of array elements (2)";
}

# W/ negative indices:
{
my @array = <a b c d>;
#?pugs todo
is ~@array.delete(*-2), "c",
"deletion of array element accessed by an negative index returned the right thing";
# @array is now ("a", "b", Any, "d") ==> double spaces
#?pugs todo
is make-string(@array), "a b Any() d", "deletion of an array element accessed by an negative index (1)";
is +@array, 4, "deletion of an array element accessed by an negative index (2)";

#?pugs todo
is ~@array.delete(*-1), "d",
"deletion of last array element returned the right thing";
# @array is now ("a", "b")
#?pugs todo
is ~@array, "a b", "deletion of last array element (1)";
#?pugs todo
is +@array, 2, "deletion of last array element (2)";
}

# W/ multiple positive and negative indices:
#?pugs todo
{
my @array = <a b c d e f>;
is ~@array.delete(2, *-3, *-1), "c d f",
Expand All @@ -60,6 +68,7 @@ sub make-string(@a) {
# Results taken from Perl 5
#?niecza todo "Not sure if this test is correct or not"
#?rakudo todo "Not sure if this test is correct or not"
#?pugs todo "Not sure if this test is correct or not"
{
my @array = <a b c>;
is ~@array.delete(2, *-1), "c b",
Expand All @@ -71,6 +80,7 @@ sub make-string(@a) {
}

# L<S32::Containers/"Array"/"Deleted elements at the end of an Array">
#?pugs todo
{
my @array;
@array[8] = 'eight';
Expand Down Expand Up @@ -105,6 +115,7 @@ sub make-string(@a) {
# RT #67446
{
my @array = 0..1;
#?pugs todo
is ~(eval @array.perl ), '0 1', '@array.perl works after init';
is ~( map { 1 }, @array ), '1 1', 'map @array works after init';
@array.delete(0);
Expand Down

0 comments on commit fa12fff

Please sign in to comment.