Skip to content

Commit

Permalink
pugs unfudge
Browse files Browse the repository at this point in the history
  • Loading branch information
coke committed Apr 25, 2012
1 parent 47bf8e1 commit ebb9ec5
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 33 deletions.
1 change: 0 additions & 1 deletion S02-names/symbolic-deref.t
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ my $outer = 'outside';

cmp_ok &::("say"), &infix:<===>, &say,
"symbolic dereferentiation of CORE subs works (1)";
#?pugs skip "todo"
ok &::("so")(42),
"symbolic dereferentiation of CORE subs works (2)";
is &::("truncate")(3.1), 3,
Expand Down
12 changes: 3 additions & 9 deletions S02-types/array.t
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,11 @@ is(@array1.[0], 'foo', 'got the right value at array1 index 0 using the . notati


# array with strings, numbers and undef
#?pugs emit my @array2;
#?pugs emit #
my @array2 = ("test", 1, Mu);

{
isa_ok(@array2, Array);

#?pugs 3 todo
is(+@array2, 3, 'the array2 has 3 elements');
is(@array2[0], 'test', 'got the right value at array2 index 0');
is(@array2[1], 1, 'got the right value at array2 index 1');
Expand All @@ -78,7 +75,6 @@ my @array2 = ("test", 1, Mu);
is(@array3[0], 'foo', 'got the right value at array3 index 0');
is(@array3[1], 'bar', 'got the right value at array3 index 1');
is(@array3[2], 'baz', 'got the right value at array3 index 2');
#?pugs 2 todo
is(@array3[3], 'test', 'got the right value at array3 index 3');
is(@array3[4], 1, 'got the right value at array3 index 4');
ok(!@array3[5].defined,'got the right value at array3 index 5');
Expand All @@ -91,7 +87,6 @@ my @array2 = ("test", 1, Mu);

is(+@array4, 3, 'the array4 has 3 elements');
ok(!defined(@array4[0]), 'got the right value at array4 index 0');
#?pugs 2 todo
is(@array4[1], 1, 'got the right value at array4 index 1');
is(@array4[2], 'test', 'got the right value at array4 index 2');
}
Expand All @@ -103,7 +98,6 @@ my @array2 = ("test", 1, Mu);

is(+@array5, 6, 'the array5 has 6 elements');
ok(!defined(@array5[0]), 'got the right value at array5 index 0');
#?pugs 2 todo
is(@array5[1], 1, 'got the right value at array5 index 1');
is(@array5[2], 'test', 'got the right value at array5 index 2');
is(@array5[3], 'baz', 'got the right value at array5 index 3');
Expand Down Expand Up @@ -156,7 +150,7 @@ my @array2 = ("test", 1, Mu);
is(+@array10, 3, "trailing commas make correct array");
}

#?pugs skip "multi-dim arrays not implemented"
#?pugs todo "multi-dim arrays not implemented"
#?rakudo skip "multi-dim arrays"
#?niecza skip "multi-dim arrays"
{
Expand Down Expand Up @@ -229,19 +223,19 @@ my @array2 = ("test", 1, Mu);
is @arr[0], "new value", "modifying of array contents (constants) works";
}

#?pugs skip "no whatever star yet"
{
my @arr;
lives_ok { @arr[*-1] }, "readonly accessing [*-1] of an empty array is ok (1)";
ok !(try { @arr[*-1] }), "readonly accessing [*-1] of an empty array is ok (2)";
#?pugs 2 todo
dies_ok { @arr[*-1] = 42 }, "assigning to [*-1] of an empty array is fatal";
dies_ok { @arr[*-1] := 42 }, "binding [*-1] of an empty array is fatal";
}

#?pugs skip "no whatever star yet"
{
my @arr = (23);
lives_ok { @arr[*-2] }, "readonly accessing [*-2] of an one-elem array is ok (1)";
#?pugs 3 todo
ok !(try { @arr[*-2] }), "readonly accessing [*-2] of an one-elem array is ok (2)";
dies_ok { @arr[*-2] = 42 }, "assigning to [*-2] of an one-elem array is fatal";
dies_ok { @arr[*-2] := 42 }, "binding [*-2] of an empty array is fatal";
Expand Down
2 changes: 0 additions & 2 deletions S02-types/subset.t
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ dies_ok { eval('Even.new') }, 'Cannot instantiate a subtype';
#?pugs emit #
subset Digit of Int where ^10;

#?pugs skip 'needs previous emit'
{
my Digit $x = 3;
is $x, 3, "Can assign to var with 'subset' type constraint";
Expand Down Expand Up @@ -178,7 +177,6 @@ dies_ok { my Digit $x = 3.1 },

#?pugs emit #
subset Bug::RT80930 of Int where { $_ %% 2 };
#?pugs skip 'needs previous emit'
lives_ok { my Bug::RT80930 $rt80930 }, 'subset with "::" in the name';

# RT #95500
Expand Down
3 changes: 1 addition & 2 deletions S03-operators/context-forcers.t
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ sub iis(Mu $a, Mu $b, $descr) {
iis ?(?"3"), True, "? context forcer works (13)";
iis ?(?"0"), False, "? context forcer works (14)";

#?pugs skip 'Mu'
iis ?Mu, False, "? context forcer works (15)";
}
{ # L<S02/"Names and Variables" /In boolean contexts/>
Expand Down Expand Up @@ -62,7 +61,7 @@ sub iis(Mu $a, Mu $b, $descr) {
is ~"0", "0", "~ context forcer works (4)";
is ~"", "", "~ context forcer works (5)";
#?rakudo skip '~Mu'
#?pugs skip 'Mu'
#?pugs todo 'Mu'
is ~Mu, "", "~ context forcer works (6)";
is ~"Inf", "Inf", "~ context forcer works (7)";
is ~"-Inf", "-Inf", "~ context forcer works (8)";
Expand Down
2 changes: 1 addition & 1 deletion S03-operators/eqv.t
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ plan 52;

#?rakudo skip 'captures'
#?niecza skip 'Cannot use value like Capture as a number'
#?pugs skip "Mu"
{
ok !(\3 eqv \4), "eqv on anonymous scalar references (1)";
# XXX the following seems bogus nowadays
#?pugs 2 todo
ok !(\3 eqv \3), "eqv on anonymous scalar references (2)";
ok !(\Mu eqv \Mu), "eqv on anonymous scalar references (3)";
}
Expand Down
1 change: 0 additions & 1 deletion S03-operators/increment.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Verify that autoincrement/autodecrement work properly.
=end description

#?pugs skip 'Mu'
{
my $a = Mu;
is($a++, 0, 'Mu++ == 0');
Expand Down
1 change: 0 additions & 1 deletion S03-operators/misc.t
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ is("text " ~ "stitching", "text stitching", 'concatenation with ~ operator');

# L<S03/Tight or precedence/short-circuit inclusive-or>
is(2 || 3, 2, "|| returns first true value");
#?pugs skip 'Mu'
ok(!(defined( 0 || Mu)), "|| returns last false value of list?");

{
Expand Down
4 changes: 0 additions & 4 deletions S03-operators/range-int.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ is ~(-17^..-19), '', '-17^..-19';
#?pugs skip 'empty list'
is ~(-17^..^-19), '', '-17^..^-19';
is ~(-17..-18), '', '-17..-18';
#?pugs skip 'empty list'
is ~(-17..^-18), '', '-17..^-18';
#?pugs skip 'empty list'
is ~(-17^..-18), '', '-17^..-18';
Expand Down Expand Up @@ -77,7 +76,6 @@ is ~(-3..^-5), '', '-3..^-5';
is ~(-3^..-5), '', '-3^..-5';
#?pugs skip 'empty list'
is ~(-3^..^-5), '', '-3^..^-5';
#?pugs skip 'empty list'
is ~(-3..-4), '', '-3..-4';
is ~(-3..^-4), '', '-3..^-4';
#?pugs skip 'empty list'
Expand Down Expand Up @@ -152,7 +150,6 @@ is ~(-2..^-3), '', '-2..^-3';
is ~(-2^..-3), '', '-2^..-3';
#?pugs skip 'empty list'
is ~(-2^..^-3), '', '-2^..^-3';
#?pugs skip 'empty list'
is ~(-2..-2), '-2', '-2..-2';
is ~(-2..^-2), '', '-2..^-2';
is ~(-2^..-2), '', '-2^..-2';
Expand All @@ -163,7 +160,6 @@ is ~(-2^..-1), '-1', '-2^..-1';
is ~(-2^..^-1), '', '-2^..^-1';
is ~(-2..0), '-2 -1 0', '-2..0';
is ~(-2..^0), '-2 -1', '-2..^0';
#?pugs skip 'empty list'
is ~(-2^..0), '-1 0', '-2^..0';
is ~(-2^..^0), '-1', '-2^..^0';
is ~(-2..1), '-2 -1 0 1', '-2..1';
Expand Down
3 changes: 0 additions & 3 deletions S03-operators/short-circuit.t
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ sub accumtest($expect, $op) {
is(0 || 42, 42, "|| operator working");
is((0 or 42), 42, "or operator working");

#?pugs 2 skip 'Mu'
is((Mu // 42), 42, "// operator working"); #"
is((Mu orelse 42), 42, "orelse operator working");

Expand All @@ -166,7 +165,6 @@ sub accumtest($expect, $op) {
is(1 ^^ 42, False, "^^ operator working (both true)");
#?pugs todo
is(0 ^^ 0, 0, "^^ operator working (both false)");
#?pugs 6 skip 'xor'
is((0 xor 42), 42, "xor operator working (one true)");
is((42 xor 0), 42, "xor operator working (one true)");
is((0 xor 42), 42, "xor operator working (one true)");
Expand Down Expand Up @@ -201,7 +199,6 @@ sub accumtest($expect, $op) {

#?rakudo skip 'segmentation fault'
isa_ok 7 ^^ 7, Bool, '^^ can return a Bool';
#?pugs skip 'Mu'
isa_ok 7 ^^ Mu, Int, '^^ can return an Int';
#?pugs 2 skip 'Range'
isa_ok 0 ^^ ^7, Range, '^^ can return a Range';
Expand Down
1 change: 0 additions & 1 deletion S03-smartmatch/any-callable.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ plan 6;
}

#L<S03/"Smart matching"/Any Callable:() simple closure truth>
#?pugs skip 'Mu'
{
sub uhuh { 1 }
sub nuhuh { Mu }
Expand Down
11 changes: 5 additions & 6 deletions S03-smartmatch/any-num.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,18 @@ plan 18;

#?pugs todo
ok ('05' ~~ 5), '$something ~~ Int numifies';
#?pugs skip 'Rat'
#?pugs todo 'Rat'
ok ('05' ~~ 5.Rat), '$something ~~ Rat numifies';
#?pugs skip 'Num'
#?pugs todo 'Num'
ok ('05' ~~ 5.Num), '$something ~~ Num numifies';

ok ('1.2' ~~ 1.2), '$thing ~~ Rat does numeric comparison';
#?pugs skip 'Num'
ok ('1.2' ~~ 1.2.Num), '$thing ~~ Num does numeric comparison';

# yes, this warns, but it should still be true
#?rakudo 2 skip "Mu ~~ Num doesn't work yet"
#?niecza skip 'Nominal type check failed for #1'
#?pugs 2 skip 'Mu'
#?pugs skip 'Mu'
ok (Mu ~~ 0), 'Mu ~~ 0';
#?niecza skip 'Nominal type check failed for #1'
ok !(Mu ~~ 2.3), 'Mu ~~ $other_number';
Expand All @@ -30,11 +29,11 @@ plan 18;
ok (3+0i ~~ 3), 'Complex ~~ Int (+)';
nok (3+1i ~~ 3), 'Complex ~~ Int (-)';
nok (4+0i ~~ 3), 'Complex ~~ Int (-)';
#?pugs 3 skip 'Rat'
#?pugs todo
ok (3+0i ~~ 3.Rat), 'Complex ~~ Rat (+)';
nok (3+1i ~~ 3.Rat), 'Complex ~~ Rat (-)';
nok (4+0i ~~ 3.Rat), 'Complex ~~ Rat (-)';
#?pugs 3 skip 'Num'
#?pugs todo
ok (3+0i ~~ 3.Num), 'Complex ~~ Num (+)';
nok (3+1i ~~ 3.Num), 'Complex ~~ Num (-)';
nok (4+0i ~~ 3.Num), 'Complex ~~ Num (-)';
Expand Down
2 changes: 1 addition & 1 deletion S03-smartmatch/any-str.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plan 5;
ok !(4 !~~ '4'), 'negated string equality';
#?rakudo skip 'smartmatching Mu against Str'
#?niecza skip 'Mu as argument'
#?pugs skip 'Mu'
#?pugs todo 'Mu'
ok (Mu ~~ ''), 'Mu ~~ ""';
}

Expand Down
1 change: 0 additions & 1 deletion S03-smartmatch/disorganized.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ sub eval_elsewhere($code){ eval($code) }
ok("foo" ~~ .defined, "foo is ~~ .defined");
#?pugs todo
nok "foo" !~~ .defined, 'not foo !~~ .defined';
#?pugs skip 'Mu'
nok((Mu ~~ .defined), "Mu is not .defined");
}

Expand Down

0 comments on commit ebb9ec5

Please sign in to comment.