From dc27da87d35f99f070742a12730c0e776cd061ee Mon Sep 17 00:00:00 2001 From: "Will \"Coke\" Coleda" Date: Wed, 11 Apr 2012 14:23:42 -0400 Subject: [PATCH] pugs fudge - Mu moritz++ --- S02-types/array.t | 10 +++++----- S02-types/array_ref.t | 9 --------- S02-types/declare.t | 1 - S02-types/hash.t | 1 + S02-types/type.t | 3 ++- S03-operators/repeat.t | 1 - S04-declarations/my.t | 1 - S04-phasers/start.t | 2 +- S09-hashes/objecthash.t | 1 + S12-construction/destruction.t | 1 + S32-list/join.t | 4 +--- S32-list/map.t | 2 -- 12 files changed, 12 insertions(+), 24 deletions(-) diff --git a/S02-types/array.t b/S02-types/array.t index 089942cef9..a4f34cbe89 100644 --- a/S02-types/array.t +++ b/S02-types/array.t @@ -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 .[]'; } diff --git a/S02-types/array_ref.t b/S02-types/array_ref.t index 2e351b9b38..8aee22bb29 100644 --- a/S02-types/array_ref.t +++ b/S02-types/array_ref.t @@ -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 = 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"; diff --git a/S02-types/declare.t b/S02-types/declare.t index cb1304c22c..8485da198d 100644 --- a/S02-types/declare.t +++ b/S02-types/declare.t @@ -218,7 +218,6 @@ plan 79; isa_ok($vo,Whatever ); } -#?pugs skip 'Mu' { my Mu $mu; ok($mu ~~ Mu ); diff --git a/S02-types/hash.t b/S02-types/hash.t index d16510d7d7..2af1923cb9 100644 --- a/S02-types/hash.t +++ b/S02-types/hash.t @@ -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'; } diff --git a/S02-types/type.t b/S02-types/type.t index 979c3b4620..8f29bacccf 100644 --- a/S02-types/type.t +++ b/S02-types/type.t @@ -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'; diff --git a/S03-operators/repeat.t b/S03-operators/repeat.t index b44a07141a..a5dbd18f01 100644 --- a/S03-operators/repeat.t +++ b/S03-operators/repeat.t @@ -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'); diff --git a/S04-declarations/my.t b/S04-declarations/my.t index ac497790a0..dc18e5a5ac 100644 --- a/S04-declarations/my.t +++ b/S04-declarations/my.t @@ -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'; diff --git a/S04-phasers/start.t b/S04-phasers/start.t index e79ca79740..5c306c13df 100644 --- a/S04-phasers/start.t +++ b/S04-phasers/start.t @@ -102,7 +102,6 @@ for { # 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 { nok $sub().defined, 'START {} returned undefined'; $sub(); $sub(); + #?pugs todo is $was_in_start, 1, 'our START { ...; Mu } block was invoked exactly once'; } diff --git a/S09-hashes/objecthash.t b/S09-hashes/objecthash.t index 8ca5d97001..94792c370c 100644 --- a/S09-hashes/objecthash.t +++ b/S09-hashes/objecthash.t @@ -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'; diff --git a/S12-construction/destruction.t b/S12-construction/destruction.t index b7caab6504..a9c4430513 100644 --- a/S12-construction/destruction.t +++ b/S12-construction/destruction.t @@ -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' ); diff --git a/S32-list/join.t b/S32-list/join.t index 17b39fb65c..88b075f91d 100644 --- a/S32-list/join.t +++ b/S32-list/join.t @@ -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 ??? diff --git a/S32-list/map.t b/S32-list/map.t index 38ab6024d2..737731fdc2 100644 --- a/S32-list/map.t +++ b/S32-list/map.t @@ -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 = ; 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 = ; my $undef = Mu;