From a20c69c22383feea5ca74736fc02bffa55dd30ed Mon Sep 17 00:00:00 2001 From: lwall Date: Sun, 10 Feb 2008 18:05:24 +0000 Subject: [PATCH] [t/spec/*.t] :todo whackage git-svn-id: http://svn.pugscode.org/pugs@19876 c213334d-75ef-0310-aa23-eaa082d1ae64 --- S02-whitespace_and_comments/unspace.t | 3 ++- S29-container/roundrobin.t | 4 +-- S29-container/zip.t | 12 +++++---- S29-hash/slice.t | 15 ++++-------- S29-list/classify.t | 32 ++++++++++++++---------- S29-list/grep.t | 5 ++-- S29-list/join.t | 3 ++- S29-list/map.t | 8 +++--- S29-list/map_empty_list.t | 3 ++- S29-list/minmax.t | 5 ++-- S29-list/reduce.t | 5 ++-- S29-list/sort.t | 5 ++-- S29-list/uniq.t | 6 ++--- S29-scalar/undef.t | 35 ++++++++++++++++----------- 14 files changed, 80 insertions(+), 61 deletions(-) diff --git a/S02-whitespace_and_comments/unspace.t b/S02-whitespace_and_comments/unspace.t index 6da1f232a3..f43d379a17 100644 --- a/S02-whitespace_and_comments/unspace.t +++ b/S02-whitespace_and_comments/unspace.t @@ -37,7 +37,8 @@ eval " @array»\ .++; @array\ .»\ .++; "; -is( ~@array, "7 8 9", 'unspace with postfix hyperops', :todo); +#?pugs todo 'unimpl' +is( ~@array, "7 8 9", 'unspace with postfix hyperops'); #Test the "unspace" and unspace syntax diff --git a/S29-container/roundrobin.t b/S29-container/roundrobin.t index 72adaa0507..d0d5535d02 100644 --- a/S29-container/roundrobin.t +++ b/S29-container/roundrobin.t @@ -40,7 +40,7 @@ flunk('roundrobin :finite'); =begin lazy_roundrobin -ok(roundrobin(:finite, 1; 1..2; 1..3) eqv (1), 'roundrobin :shortest', - :todo); +#?pugs todo 'feature' +ok(roundrobin(:finite, 1; 1..2; 1..3) eqv (1), 'roundrobin :shortest'); =end lazy_roundrobin diff --git a/S29-container/zip.t b/S29-container/zip.t index 3d01774ef8..c5f57196dc 100644 --- a/S29-container/zip.t +++ b/S29-container/zip.t @@ -52,9 +52,9 @@ plan 9; my @z; @z = zip(zip(@a; @b); @c); my @x; @x = ((@a Z @b) Z @c); - is(~@z, ~@e, "zip of zipped arrays with other array", :todo, - :depends); - is(~@x, ~@e, "also as Z", :todo, :depends); +#?pugs 2 todo 'needs Seq' + is(~@z, ~@e, "zip of zipped arrays with other array"); + is(~@x, ~@e, "also as Z"); }; { @@ -72,6 +72,8 @@ plan 9; (@a Z @b) = (1, 2, 3, 4); # XXX - The arrays below are most likely Seq's - is(@a, [1, 3], "first half of two zipped arrays as lvalues", :todo); - is(@b, [2, 4], "second half of the lvalue zip", :todo); +#?pugs todo 'unimpl' + is(@a, [1, 3], "first half of two zipped arrays as lvalues"); +#?pugs todo 'unimpl' + is(@b, [2, 4], "second half of the lvalue zip"); } diff --git a/S29-hash/slice.t b/S29-hash/slice.t index 5242e11c7b..184b9d121d 100644 --- a/S29-hash/slice.t +++ b/S29-hash/slice.t @@ -30,18 +30,13 @@ plan 25; is(%hash{@slice[0,1]}, (4,6), "slice from array slice, part 2"); } -=begin pod -# unspecced - -# Behaviour assumed to be the same as Perl 5 -{ my %hash = (:a(1), :b(2), :c(3), :d(4)); +#?pugs todo 'feature' +{ + my %hash = :a(1), :b(2), :c(3), :d(4); my @slice := %hash; - is ~(@slice = ), "A B", - "assigning a slice too many items yields a correct return value", - :todo; + is ~((@slice,*) = ), "A B", + "assigning a slice too many items yields a correct return value"; } -=end pod - # Slices on hash literals { is ~({:a(1), :b(2), :c(3), :d(4)}), "2 3", "slice on hashref literal"; diff --git a/S29-list/classify.t b/S29-list/classify.t index 2057842214..f309dfd8ce 100644 --- a/S29-list/classify.t +++ b/S29-list/classify.t @@ -5,24 +5,30 @@ use Test; plan 11; -my @list = (1, 2, 3, 4); -my (@even,@odd); -ok(eval(q"(:@even, :@odd) := classify { $_ % 2 ?? 'odd' !! 'even' } 1,2,3,4; "), :todo ); -is_deeply(@even, [2,4], "got expected evens", :todo); -is_deeply(@even, [1,3], "got expected odds", :todo); - -my %by_five; -ok(eval(q" %by_five = classify { $_ * 5 } 1,2,3,4 "), :todo); +#?pugs todo 'feature' +{ + my @list = (1, 2, 3, 4); + my (@even,@odd); + ok(eval(q"(:@even, :@odd) := classify { $_ % 2 ?? 'odd' !! 'even' } 1,2,3,4; ") ); + is_deeply(@even, [2,4], "got expected evens"); + is_deeply(@even, [1,3], "got expected odds"); +} -is( %by_five{5}, 1, :todo); -is( %by_five{10}, 2, :todo); -is( %by_five{15}, 3, :todo); -is( %by_five{20}, 4, :todo ); +#?pugs todo 'feature' +{ + my %by_five; + ok(eval(q" %by_five = classify { $_ * 5 } 1,2,3,4 ")); + is( %by_five{5}, 1); + is( %by_five{10}, 2); + is( %by_five{15}, 3); + is( %by_five{20}, 4); +} # .classify shouldn't work on non-arrays { dies_ok { 42.classify:{ $_ } }, "method form of classify should not work on numbers"; dies_ok { "str".classify:{ $_ } }, "method form of classify should not work on strings"; - is eval(q<<< ~(42,).classify:{ 1 } >>>), "42", "method form of classify should work on arrays", :todo; +#?pugs todo 'feature' + is eval(q<<< ~(42,).classify:{ 1 } >>>), "42", "method form of classify should work on arrays"; } diff --git a/S29-list/grep.t b/S29-list/grep.t index 837bd3640c..d504abcb27 100644 --- a/S29-list/grep.t +++ b/S29-list/grep.t @@ -55,8 +55,9 @@ my @list = (1 .. 10); # .grep shouldn't work on non-arrays { - dies_ok { 42.grep:{ $_ } }, "method form of grep should not work on numbers", :todo; - dies_ok { "str".grep:{ $_ } }, "method form of grep should not work on strings", :todo; + #?pugs 2 todo 'bug' + dies_ok { 42.grep:{ $_ } }, "method form of grep should not work on numbers"; + dies_ok { "str".grep:{ $_ } }, "method form of grep should not work on strings"; is ~(42,).grep:{ 1 }, "42", "method form of grep should work on arrays"; } diff --git a/S29-list/join.t b/S29-list/join.t index f1cee4e76c..ff98ffbcc8 100644 --- a/S29-list/join.t +++ b/S29-list/join.t @@ -107,4 +107,5 @@ is(("hi",).join("!"), "hi", "&join works with one-element lists (3)"); dies_ok({ join() }, 'join() must have arguments'); # Similar as with .kv: (42).kv should die, but (42,).kv should work. -dies_ok({ "hi".join("!") }, "join() should not work on strings", :todo); +#?pugs todo 'bug' +dies_ok({ "hi".join("!") }, "join() should not work on strings"); diff --git a/S29-list/map.t b/S29-list/map.t index 8eece48608..f9d75a3746 100644 --- a/S29-list/map.t +++ b/S29-list/map.t @@ -107,8 +107,9 @@ my @list = (1 .. 5); # .map shouldn't work on non-arrays { - dies_ok { 42.map:{ $_ } }, "method form of map should not work on numbers", :todo; - dies_ok { "str".map:{ $_ } }, "method form of map should not work on strings", :todo; + #?pugs 2 todo 'bug' + dies_ok { 42.map:{ $_ } }, "method form of map should not work on numbers"; + dies_ok { "str".map:{ $_ } }, "method form of map should not work on strings"; is ~(42,).map:{ $_ }, "42", "method form of map should work on arrays"; } @@ -138,7 +139,8 @@ should be equivalent to is(+@b,3, "should be 3 elemens"); my @c = map { {"v"=>$_, "d" => $_*2} }, @a; - is(+@c,3, "should be 3 elemens without the hash keyword as well", :todo); +#?pugs todo 'unimpl' + is(+@c,3, "should be 3 elemens without the hash keyword as well"); } # diff --git a/S29-list/map_empty_list.t b/S29-list/map_empty_list.t index 444295c9f1..dfc2125a25 100644 --- a/S29-list/map_empty_list.t +++ b/S29-list/map_empty_list.t @@ -27,12 +27,13 @@ plan 7; is +@result, 4, "map works with the map body returning an empty arrayref"; } +#?pugs todo 'bug' { my @array = ; my $empty = []; my @result = map { $empty }, @array; - is +@result, 4, "map works with the map body returning an empty arrayref variable", :todo; + is +@result, 4, "map works with the map body returning an empty arrayref variable"; } { diff --git a/S29-list/minmax.t b/S29-list/minmax.t index 98c51faabc..620fcb7970 100644 --- a/S29-list/minmax.t +++ b/S29-list/minmax.t @@ -56,8 +56,9 @@ is max({ abs $^a <=> abs $^b }, @array), -9, "subroutine form of max taking a comparision block works"; # Error cases: -dies_ok { 42.max }, ".max should not work on scalars", :todo; -dies_ok { 42.min }, ".min should not work on scalars", :todo; +#?pugs 2 todo 'bug' +dies_ok { 42.max }, ".max should not work on scalars"; +dies_ok { 42.min }, ".min should not work on scalars"; is (42,).max, 42, ".max should work on one-elem arrays"; is (42,).max, 42, ".max should work on one-elem arrays"; diff --git a/S29-list/reduce.t b/S29-list/reduce.t index ddb3534ed9..d7c3b88328 100644 --- a/S29-list/reduce.t +++ b/S29-list/reduce.t @@ -34,8 +34,9 @@ plan 11; # .reduce shouldn't work on non-arrays { - dies_ok { 42.reduce:{ $^a + $^b } }, "method form of reduce should not work on numbers", :todo; - dies_ok { "str".reduce:{ $^a + $^b } }, "method form of reduce should not work on strings", :todo; +#?pugs 2 todo 'bug' + dies_ok { 42.reduce:{ $^a + $^b } }, "method form of reduce should not work on numbers"; + dies_ok { "str".reduce:{ $^a + $^b } }, "method form of reduce should not work on strings"; is (42,).reduce:{ $^a + $^b }, 42, "method form of reduce should work on arrays"; } diff --git a/S29-list/sort.t b/S29-list/sort.t index e34ff0f40c..c0ff94a28b 100644 --- a/S29-list/sort.t +++ b/S29-list/sort.t @@ -150,7 +150,8 @@ plan 21; # .sort shouldn't work on non-arrays { - dies_ok { 42.sort:{ 0 } }, "method form of sort should not work on numbers", :todo; - dies_ok { "str".sort:{ 0 } }, "method form of sort should not work on strings", :todo; +#?pugs 2 todo 'bug' + dies_ok { 42.sort:{ 0 } }, "method form of sort should not work on numbers"; + dies_ok { "str".sort:{ 0 } }, "method form of sort should not work on strings"; is ~(42,).sort:{ 0 }, "42", "method form of sort should work on arrays"; } diff --git a/S29-list/uniq.t b/S29-list/uniq.t index 87374cbb54..725f6957fc 100644 --- a/S29-list/uniq.t +++ b/S29-list/uniq.t @@ -32,12 +32,12 @@ See the thread "[S29] uniq" on p6l, too. is ~uniq({ lc $^a eq lc $^b }, @array), "a b c d", "subroutine form of uniq with own comparator works"; # Semantics w/ junctions - # is eval('~@array.uniq:{ lc $^a eq lc $^b }.values.sort'), - # "A b c d a b c d", :todo; + # is eval('~@array.uniq:{ lc $^a eq lc $^b }.values.sort'), "A b c d a b c d"; } # Error cases { - dies_ok { 42.uniq }, ".uniq should not work on scalars", :todo; + #?pugs todo 'bug' + dies_ok { 42.uniq }, ".uniq should not work on scalars"; is (42,).uniq, 42, ".uniq should work on one-elem arrays"; } diff --git a/S29-scalar/undef.t b/S29-scalar/undef.t index be67064b80..b7ab9115c0 100644 --- a/S29-scalar/undef.t +++ b/S29-scalar/undef.t @@ -83,10 +83,12 @@ ok(!defined(undef), "undef is not defined"); ok(defined(%hash), "aggregate hash defined"); undefine(@ary); - ok(!defined(@ary), "undefine array",:todo); +#?pugs todo 'bug' + ok(!defined(@ary), "undefine array"); undefine(%hash); - ok(!defined(%hash), "undefine hash",:todo); +#?pugs todo 'bug' + ok(!defined(%hash), "undefine hash"); @ary = (1); ok(defined(@ary), "define array again"); @@ -98,10 +100,13 @@ ok(!defined(undef), "undef is not defined"); sub a_sub { "møøse" } ok(defined(&a_sub), "defined sub"); - ok(eval('defined(%«$?PACKAGE\::»<&a_sub>)'), "defined sub (symbol table)", :todo); +#?pugs todo 'parsefail' + ok(eval('defined(%«$?PACKAGE\::»<&a_sub>)'), "defined sub (symbol table)"); - ok(eval('!defined(&a_subwoofer)'), "undefined sub",:todo); - ok(eval('!defined(%«$?PACKAGE\::»<&a_subwoofer>)'), "undefined sub (symbol table)", :todo); +#?pugs todo 'feature' + ok(eval('!defined(&a_subwoofer)'), "undefined sub"); +#?pugs todo 'feature' + ok(eval('!defined(%«$?PACKAGE\::»<&a_subwoofer>)'), "undefined sub (symbol table)"); } # TODO: find a read-only value to try and assign to, since we don't @@ -222,12 +227,14 @@ else { # I want symbolic lookups because I need the rx names for test results. eval '"1" ~~ %MY::{$_}'; - ok(defined($num), '{$_}: successful hypothetical', :todo); +#?pugs todo 'unimpl' + ok(defined($num), '{$_}: successful hypothetical'); ok(!defined($alpha), '{$_}: failed hypothetical'); eval '"A" ~~ %MY::{$_}'; ok(!defined($num), '{$_}: failed hypothetical (2nd go)'); - ok(defined($alpha), '{$_}: successful hypothetical (2nd go)', :todo); +#?pugs todo 'unimpl' + ok(defined($alpha), '{$_}: successful hypothetical (2nd go)'); } } @@ -238,12 +245,12 @@ if ! eval '"a" ~~ /a/' { else { # - binding to hash keys only would leave values undef eval '"a=b\nc=d\n" ~~ / $ := [ (\w) = \N+ ]* /'; - ok(eval('$ ~~ all()'), "match keys exist", :todo); - - #ok(!defined($) && !defined($), "match values don't", :todo); - ok(0 , "match values don't", :todo); -} +#?pugs todo 'unimpl' + ok(eval('$ ~~ all()'), "match keys exist"); + #ok(!defined($) && !defined($), "match values don't"); +#?pugs todo 'unimpl' + ok(0 , "match values don't") { # - $0, $1 etc. should all be undef after a failed match # (except for special circumstances) @@ -321,6 +328,6 @@ is((undef) * (undef), 0, 'undef * undef'); # L # See log above. From IRC, TimToady says that both of these # should be false. (At time of writing, @(undef,) is true.) -is ?(@(undef,)), Bool::False, '?(@(undef,)) is false', :todo, - :depends<@() imposing context and not [] constructor>; +#?pugs todo 'feature', :depends<@() imposing context and not [] constructor>; +is ?(@(undef,)), Bool::False, '?(@(undef,)) is false'; is ?(list(undef,)), Bool::False, '?(@(undef,)) is false';