Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

pugs fudge - Mu

moritz++
  • Loading branch information...
commit dc27da87d35f99f070742a12730c0e776cd061ee 1 parent 395bd85
Will Coleda coke authored
10 S02-types/array.t
View
@@ -59,10 +59,10 @@ is(@array1.[0], 'foo', 'got the right value at array1 index 0 using the . notati
#?pugs emit #
my @array2 = ("test", 1, Mu);
-#?pugs skip "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');
@@ -74,7 +74,6 @@ my @array2 = ("test", 1, Mu);
my @array3 = (@array1, @array2);
isa_ok(@array3, Array);
- #?pugs todo
is(+@array3, 6, 'the array3 has 6 elements');
is(@array3[0], 'foo', 'got the right value at array3 index 0');
is(@array3[1], 'bar', 'got the right value at array3 index 1');
@@ -276,12 +275,13 @@ my @array2 = ("test", 1, Mu);
# defined in Any, so that .[0] is the identity operation for non-Positional
# types
#?niecza skip "Failure"
-#?pugs skip "Failure"
{
- is 1[0], 1, '.[0] is identiity operation for scalars (Int)';
- is 'abc'[0], 'abc', '.[0] is identiity operation for scalars (Str)';
+ is 1[0], 1, '.[0] is identity operation for scalars (Int)';
+ is 'abc'[0], 'abc', '.[0] is identity operation for scalars (Str)';
nok 'abc'[1].defined, '.[1] on a scalar is not defined';
+ #?pugs skip "Failure"
isa_ok 1[1], Failure, 'indexing a scalar with other than 0 returns a Failure';
+ #?pugs todo
dies_ok { Mu.[0] }, 'but Mu has no .[]';
}
9 S02-types/array_ref.t
View
@@ -21,9 +21,7 @@ is($array_ref1.[0], 'foo', 'got the right value at array_ref1 index 0 using the
# array_ref with strings, numbers and undef
-#?pugs emit #
my $array_ref2 = [ "test", 1, Mu ];
-#?pugs 5 skip 'Mu'
isa_ok($array_ref2, Array);
is(+$array_ref2, 3, 'the array_ref2 has 3 elements');
is($array_ref2[0], 'test', 'got the right value at array_ref2 index 0');
@@ -36,12 +34,9 @@ ok(!$array_ref2[2].defined,'got the right value at array_ref2 index 2');
# the [] creation must be forced here, because $array_ref<n> = is
# not seen as array_ref context, because it's not
-#?pugs emit # needs array_ref2
my $array_ref4 = [ $array_ref2[2, 1, 0] ];
-#?pugs skip 'Mu'
isa_ok($array_ref4, Array);
-#?pugs skip 'Mu'
{
is(+$array_ref4, 3, 'the array_ref4 has 3 elements');
ok(!$array_ref4[0].defined, 'got the right value at array_ref4 index 0');
@@ -51,12 +46,9 @@ isa_ok($array_ref4, Array);
# create new array_ref with 2 array_ref slices
-#?pugs emit # need array_ref2, skipped above
my $array_ref5 = [ $array_ref2[2, 1, 0], $array_ref1[2, 1, 0] ];
-#?pugs skip 'Mu'
isa_ok($array_ref5, Array);
-#?pugs skip 'Mu'
{
is(+$array_ref5, 6, 'the array_ref5 has 6 elements');
ok(!$array_ref5[0].defined, 'got the right value at array_ref5 index 0');
@@ -122,7 +114,6 @@ is $array9[1][1][1][0], 42, "recursive array access (3)";
# list is in some kind of brackets, of course).
#my $array11;
#eval '$array11 = [ "a","b","c"; "d","e","f" ]';
-##?pugs 3 todo
#is +$array11, 2, "AoA created using ';' contains correct number of elems";
#is +$array11[0], 3, "AoA's subarray created using ';' contains correct number of elems";
#is $array11[1][1], "e", "AoA created using ';' contains correct elem";
1  S02-types/declare.t
View
@@ -218,7 +218,6 @@ plan 79;
isa_ok($vo,Whatever );
}
-#?pugs skip 'Mu'
{
my Mu $mu;
ok($mu ~~ Mu );
1  S02-types/hash.t
View
@@ -250,6 +250,7 @@ lives_ok { Hash.new("a" => "b") }, 'Hash.new($pair) lives';
my $x;
lives_ok { $x{'a'} }, 'can index a variable that defaults to Any';
nok $x{'a'}.defined, '... and the result is not defined';
+ #?pugs todo
dies_ok { Mu.{'a'} }, 'no .{ } in Mu';
}
3  S02-types/type.t
View
@@ -25,11 +25,13 @@ my Str $bar;
{
#?pugs 1 todo
dies_ok({$foo = 'xyz'}, 'Int restricts to integers');
+ #?pugs todo
dies_ok { $foo = Mu }, 'Int does not accept Mu';
is(($foo = 42), 42, 'Int is an integer');
#?pugs 1 todo
dies_ok({$bar = 42}, 'Str restricts to strings');
+ #?pugs todo
dies_ok { $bar = Mu }, 'Str does not accept Mu';
is(($bar = 'xyz'), 'xyz', 'Str is a strings');
}
@@ -142,7 +144,6 @@ dies_ok { my Num $n; $n = 42; }, 'Num does not accept Int';
{
# TODO: many more of these are possible
- #?pugs 3 skip "Mu"
ok Any ~~ Mu, 'Any ~~ Mu';
ok Mu !~~ Any, 'Mu !~~ Any';
ok Mu !~~ Int, 'Mu !~~ Int';
1  S03-operators/repeat.t
View
@@ -26,7 +26,6 @@ is(@foo[0], 'x', 'list repeat operator created correct array');
is(@foo[9], 'x', 'list repeat operator created correct array');
is(+@foo, 10, 'list repeat operator created array of the right size');
-#?pugs todo
lives_ok { my @foo2 = Mu xx 2; }, 'can repeat Mu';
my @foo3 = (1, 2) xx 2;
is(@foo3[0], 1, 'can repeat lists');
1  S04-declarations/my.t
View
@@ -258,7 +258,6 @@ my $z = 42; #OK not used
eval_lives_ok 'my (%h?) #OK', 'my (%h?) lives';
#RT 63588
-#?pugs todo
eval_lives_ok 'my $x = 3; class A { has $.y = $x; }; A.new.y.gist',
'global scoped variables are visible inside class definitions';
2  S04-phasers/start.t
View
@@ -102,7 +102,6 @@ for <first second> {
# Test that START {} blocks are executed only once even if they return undefined
# (the first implementation ran them twice instead).
-#?pugs skip 'No such subroutine: "&Mu"'
{
my $was_in_start;
my $sub = { START { $was_in_start++; Mu } };
@@ -110,6 +109,7 @@ for <first second> {
nok $sub().defined, 'START {} returned undefined';
$sub();
$sub();
+ #?pugs todo
is $was_in_start, 1,
'our START { ...; Mu } block was invoked exactly once';
}
1  S09-hashes/objecthash.t
View
@@ -12,6 +12,7 @@ plan 25;
is %h{$a}, 'blubb', 'Any-typed hash access (+)';
#?pugs todo
nok %h{A.new}, 'and the hash really uses ===-semantics';
+ #?pugs todo
dies_ok { %h{Mu.new} = 3 }, 'Any-typed hash does not like Mu keys';
#?pugs todo
ok %h.keys[0] === $a, 'returned key is correct';
1  S12-construction/destruction.t
View
@@ -38,6 +38,7 @@ for 1 .. 100
$foo = Foo.new();
}
+#?pugs 2 skip 'broken after Object -> Mu conversion'
ok( $in_destructor, '... only when object goes away everywhere' );
is( +@destructor_order, 2, '... only as many as available DESTROY submethods' );
is( @destructor_order[0], 'Child', 'Child DESTROY should fire first' );
4 S32-list/join.t
View
@@ -106,12 +106,10 @@ my $joined2e = join(':', @odd_list1);
#?pugs todo
is($joined2e, "1::2::3", 'join(":", @odd_list1) works');
-#?pugs emit # Mu
my @odd_list2 = (1, Mu, 2, Mu, 3);
-#?pugs emit # Mu
my $joined2f = join(':', @odd_list2);
-#?pugs skip 'Mu'
+#?pugs todo
is($joined2f, "1::2::3", 'join(":", @odd_list2) works');
# should these even be tests ???
2  S32-list/map.t
View
@@ -171,7 +171,6 @@ is( ~((1..3).map: { dbl( $_ ) }),'2 4 6','extern method in map');
is +@result, 4, "map works with the map body returning an empty arrayref variable";
}
-#?pugs skip 'Mu'
{
my @array = <a b c d>;
my @result = map { Mu }, @array;
@@ -179,7 +178,6 @@ is( ~((1..3).map: { dbl( $_ ) }),'2 4 6','extern method in map');
is +@result, 4, "map works with the map body returning undefined";
}
-#?pugs skip 'Mu'
{
my @array = <a b c d>;
my $undef = Mu;
Please sign in to comment.
Something went wrong with that request. Please try again.