From 9028e8c50cf96df0fbf29c4e7838d655339435a7 Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Tue, 3 Sep 2013 09:24:03 +0200 Subject: [PATCH] Fudges for S32 --- S32-array/elems.t | 6 ++---- S32-array/end.t | 9 +++------ S32-exceptions/misc.t | 2 -- S32-hash/exists-adverb.t | 6 +++--- S32-hash/slice.t | 11 +++++++---- S32-list/reduce.t | 2 +- S32-list/sort.t | 2 +- S32-list/uniq.t | 10 +++++----- S32-scalar/undef.t | 4 ++-- S32-str/chop.t | 2 +- S32-str/comb.t | 3 +-- S32-str/flip.t | 2 +- S32-str/numeric.t | 7 ++++--- S32-str/rindex.t | 3 --- S32-str/split.t | 4 ++-- S32-str/uc.t | 1 - S32-trig/cosec.t | 2 ++ 17 files changed, 35 insertions(+), 41 deletions(-) diff --git a/S32-array/elems.t b/S32-array/elems.t index 7386f32a95..87dd705e23 100644 --- a/S32-array/elems.t +++ b/S32-array/elems.t @@ -20,12 +20,11 @@ plan 11; is @a.elems, 3, ".elems works on initialized arrays"; } -#?rakudo skip 'unspecced' #?niecza todo #?pugs todo { my $a; - dies_ok { $a.elems }, ".elems does not work on arbitrary scalars (1)"; + is $a.elems, 0, ".elems does works on arbitrary scalars"; } { @@ -43,9 +42,8 @@ plan 11; is $a.elems, 3, ".elems works on initialized arrayrefs (2)"; } -#?rakudo skip 'unspecced' { - dies_ok { elems(1,2,3,4) }, "elems(1,2,3,4) should not work"; + eval_dies_ok 'elems(1,2,3,4', "elems(1,2,3,4) should not work"; } { diff --git a/S32-array/end.t b/S32-array/end.t index 46bba5425e..727855df21 100644 --- a/S32-array/end.t +++ b/S32-array/end.t @@ -20,18 +20,16 @@ plan 12; is @a.end, 2, ".end works on initialized arrays"; } -#?rakudo skip 'unspecced' { my $a; #?pugs todo - dies_ok { $a.end }, ".end does not work on arbitrary scalars (1)"; + is $a.end, -1, ".end works on arbitrary scalars (1)"; } -#?rakudo skip 'unspecced' { my $a = 42; #?pugs todo - dies_ok { $a.end }, ".end does not work on arbitrary scalars (2)"; + is $a.end, 0, ".end works on arbitrary scalars (2)"; } { @@ -50,9 +48,8 @@ plan 12; is $a.end, 2, ".end works on initialized arrayrefs (2)"; } -#?rakudo skip 'unspecced' { - dies_ok { end(1,2,3,4) }, "end(1,2,3,4) should not work"; + eval_dies_ok 'end(1,2,3,4)', "end(1,2,3,4) should not work"; } #?niecza skip 'Unable to resolve method end in class Parcel' diff --git a/S32-exceptions/misc.t b/S32-exceptions/misc.t index 9ab13adc2e..174a2c9f3c 100644 --- a/S32-exceptions/misc.t +++ b/S32-exceptions/misc.t @@ -16,8 +16,6 @@ throws_like 'sub f() { $^x }', X::Signature::Placeholder, placeholder => '$^x', ; -#?rakudo skip 'parsing of $& and other p5 variables' -throws_like '$&', X::Obsolete, old => '$@ variable', replacement => '$, rx/<>// or $()'; throws_like 'qr/a/', X::Obsolete, old => rx/<>/, replacement => rx/<>/; throws_like '"a" . "b"', X::Obsolete, replacement => '~'; throws_like 's/a/b/i', X::Obsolete; diff --git a/S32-hash/exists-adverb.t b/S32-hash/exists-adverb.t index fe2cfbafc0..7a7b85a656 100644 --- a/S32-hash/exists-adverb.t +++ b/S32-hash/exists-adverb.t @@ -113,7 +113,7 @@ sub gen_hash { ok @a[ 9]:exists(1), "Test exists with (1) single elem 9"; ok !(@a[10]:exists(1)), "Test exists with (1) single elem 10"; - #?rakudo 6 skip "oh noes, it dies" + #?rakudo 6 todo "[]:exists NYI" is_deeply @a[1,2, 4]:exists, (True, True, True), "Test exists TTT"; is_deeply @a[1,2,10]:exists, (True, True, False), "Test exists TTF"; is_deeply @a[*]:exists, (True xx 26).Parcel, "Test non-exists T*"; @@ -122,7 +122,7 @@ sub gen_hash { is_deeply @a[1,2,10]:!exists, (False,False,True), "Test non-exists FFT"; is_deeply @a[*]:!exists, (False xx 26).Parcel, "Test non-exists F*"; - #?rakudo 6 skip "oh noes, it dies" + #?rakudo 6 todo "[]:exists:kv NYI" #?niezca 6 todo "no combined adverbial pairs" is_deeply @a[1,2, 4]:exists:kv, (1,True,2,True,3,True), "Test exists:kv TTT"; @@ -137,7 +137,7 @@ sub gen_hash { is_deeply @a[1,2,10]:!exists:!kv, (1,False,2,False,10,True), "Test exists:kv FFT"; - #?rakudo 6 skip "oh noes, it dies" + #?rakudo 6 todo "[]:exists:p NYI" #?niezca 6 todo "no combined adverbial pairs" is_deeply @a[1,2, 4]:exists:p, (1=>True,2=>True,3=>True), "Test exists:p TTT"; diff --git a/S32-hash/slice.t b/S32-hash/slice.t index 8bb7108621..bdbc59dc71 100644 --- a/S32-hash/slice.t +++ b/S32-hash/slice.t @@ -48,7 +48,7 @@ plan 29; } #?pugs todo 'feature' -#?rakudo skip 'binding on hash elements unimplemented' +#?rakudo todo 'binding on hash elements unimplemented' #?niecza todo 'Writing to readonly scalar' #?pugs skip "Can't modify constant item: VNum Infinity" { @@ -76,7 +76,7 @@ Quoting Larry: } # Binding on hash slices -#?rakudo skip 'binding on hash elements unimplemented' +#?rakudo todo 'binding on hash elements unimplemented' { my %hash = (:a, :b, :c); try { %hash := }; @@ -86,7 +86,7 @@ Quoting Larry: is %hash, "BAR", "binding hash slices works (1-2)"; } -#?rakudo skip 'binding on hash elements unimplemented' +#?rakudo todo 'binding on hash elements unimplemented' { my %hash = (:a, :b, :c); try { %hash := }; @@ -96,12 +96,12 @@ Quoting Larry: ok !defined(%hash), "binding hash slices works (2-2)"; } -#?rakudo skip 'binding on hash elements unimplemented' { my %hash = (:a, :b, :c); my $foo = "FOO"; my $bar = "BAR"; try { %hash := ($foo, $bar) }; + #?rakudo 2 todo 'binding on hash elements unimplemented' #?pugs 2 todo 'bug' #?niecza 2 todo is %hash, "FOO", "binding hash slices works (3-1)"; @@ -109,6 +109,7 @@ Quoting Larry: $foo = "BB"; $bar = "CC"; + #?rakudo 2 todo 'binding on hash elements unimplemented' #?niecza 2 todo #?pugs 2 todo 'bug' is %hash, "BB", "binding hash slices works (3-3)"; @@ -118,6 +119,8 @@ Quoting Larry: %hash = "CCC"; is %hash, "BBB", "binding hash slices works (3-5)"; is %hash, "CCC", "binding hash slices works (3-6)"; + + #?rakudo 2 todo 'binding on hash elements unimplemented' #?pugs 2 todo 'bug' #?niecza 2 todo is $foo, "BBB", "binding hash slices works (3-7)"; diff --git a/S32-list/reduce.t b/S32-list/reduce.t index 971c782f53..8d075abf26 100644 --- a/S32-list/reduce.t +++ b/S32-list/reduce.t @@ -28,7 +28,7 @@ plan 14; my @array = <1 2 3 4 5 6 7 8>, Any; my $result = (((1 + 2 * 3) + 4 * 5) + 6 * 7) + 8 * Any; - #?rakudo skip 'n-ary reduce' + #?rakudo todo 'n-ary reduce' #?niecza skip 'n-ary reduce' is (@array.reduce: { $^a + $^b * $^c }), $result, "n-ary reduce() works"; } diff --git a/S32-list/sort.t b/S32-list/sort.t index 5963c81ff0..c0273928b5 100644 --- a/S32-list/sort.t +++ b/S32-list/sort.t @@ -58,7 +58,7 @@ plan 32; is(@s, @e, '... with closure as indirect invocant'); } -#?rakudo skip "method fallback to sub unimpl" +#?rakudo todo "method fallback to sub unimpl" #?niecza skip 'err, what?' #?pugs todo { diff --git a/S32-list/uniq.t b/S32-list/uniq.t index 690729f7ea..1b38f65e61 100644 --- a/S32-list/uniq.t +++ b/S32-list/uniq.t @@ -31,18 +31,18 @@ See the thread "[S32::Containers] uniq" on p6l, too. } #1 # With a userspecified criterion -#?rakudo skip "Not spec'd, and this seems unlikely to be how it will be spec'd" +#?niecza skip "with NYI" #?pugs todo { - my @array = ; + my @array = ; # Semantics w/o junctions - is ~@array.uniq({ lc($^a) eq lc($^b) }), "a b c d", + is ~@array.uniq( with => { lc($^a) eq lc($^b) } ), "a b d c", "method form of uniq with own comparator works"; - is ~uniq({ lc($^a) eq lc($^b) }, @array), "a b c d", + is ~uniq(@array, with => { lc($^a) eq lc($^b) }), "a b d c", "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"; + is eval('~@array.uniq(with => { lc($^a) eq lc($^b) }).values.sort'), "a b c d", 'sorting the result'; } #3 #?pugs todo 'bug' diff --git a/S32-scalar/undef.t b/S32-scalar/undef.t index 39d821b695..67703971a2 100644 --- a/S32-scalar/undef.t +++ b/S32-scalar/undef.t @@ -234,7 +234,7 @@ Perl6-specific tests # "let keyword"> # - unmatched alternative should bind to undef -#?rakudo skip 'null PMC access in type()' +#?rakudo skip 'Cannot use bind operator with this left-hand side' #?niecza skip 'unspeclike use of %MY::' #?DOES 10 { @@ -326,7 +326,7 @@ is((Any) * (Any), 0, 'Any * Any'); # See log above. From IRC, TimToady says that both of these # should be false. (At time of writing, @(Mu,) is true.) #?pugs todo 'feature', :depends<@() imposing context and not [] constructor>; -#?rakudo 2 skip 'todo: lists, defined, truthness' +#?rakudo 2 todo 'todo: lists, defined, truthness' #?niecza 2 todo 'huh?' is ?(@(Mu,)), Bool::False, '?(@(Mu,)) is false'; is ?(list(Mu,)), Bool::False, '?(@(Mu,)) is false'; diff --git a/S32-str/chop.t b/S32-str/chop.t index 4c56d9ff0d..98b66f6005 100644 --- a/S32-str/chop.t +++ b/S32-str/chop.t @@ -3,7 +3,7 @@ use Test; # L -plan 12; +plan 6; # # Tests already covered by the specs diff --git a/S32-str/comb.t b/S32-str/comb.t index fe9e04cb9c..3f771c759e 100644 --- a/S32-str/comb.t +++ b/S32-str/comb.t @@ -25,7 +25,6 @@ is( "a\c[COMBINING DOT ABOVE, COMBINING DOT BELOW]b".comb, #?pugs skip "todo: Str.comb" -#?rakudo skip '.comb with limit' { my Str $hair = "Th3r3 4r3 s0m3 numb3rs 1n th1s str1ng"; is $hair.comb(/\d+/), <3 3 4 3 0 3 3 1 1 1>, 'no limit returns all matches'; @@ -60,7 +59,7 @@ ok("forty-two".comb() ~~ Positional, '.comb() returns something Positional' ); # comb a list #?pugs todo 'feature' -#?rakudo skip "bad all around in Rakudo-ng" +#?rakudo skip 'cannot call match, no signature matches' #?niecza skip ':Perl5' is (, ).comb(m:Perl5/\S*a\S*/), , 'comb a list'; diff --git a/S32-str/flip.t b/S32-str/flip.t index 31a202552c..281bed2fb7 100644 --- a/S32-str/flip.t +++ b/S32-str/flip.t @@ -26,7 +26,7 @@ is( 'Hello World !'.flip.flip, 'Hello World !', is( '䀻«'.flip, '«»€ä', "some unicode characters" ); #?niecza 2 todo 'graphemes not implemented' -#?rakudo 2 skip 'graphemes not implemented' +#?rakudo 2 todo 'graphemes not implemented' #?pugs 2 skip 'graphemes not implemented' is( "a\c[COMBINING DIAERESIS]b".flip, 'bä', "grapheme precomposed" ); is( "a\c[COMBINING DOT ABOVE, COMBINING DOT BELOW]b".flip, diff --git a/S32-str/numeric.t b/S32-str/numeric.t index bf05e01636..b31e1cc025 100644 --- a/S32-str/numeric.t +++ b/S32-str/numeric.t @@ -144,7 +144,6 @@ is +"+Inf", 'Inf', '+Inf'; is +"-Inf", '-Inf', '-Inf'; is +"NaN", 'NaN', 'NaN'; -#?rakudo skip "complex Str.Numeric" { check '1+2i', Complex, 1+2i; check '-1-2i', Complex, -1-2i; @@ -154,12 +153,14 @@ is +"NaN", 'NaN', 'NaN'; check '-1.0e0_0-2.0e0_0\i', Complex, -1-2i; check '3+Inf\i', Complex, 3+Inf\i; check 'Inf+2e2i', Complex, Inf+200i; -#?niecza 3 todo 'Failure' - f '3+Infi'; f '3+3i+4i'; f '3+3+4i'; } +#?rakudo todo "complex Str.Numeric" +#?niecza todo 'Failure' +f '3+Infi'; + # TODO: Complex with radix # RT #100778 diff --git a/S32-str/rindex.t b/S32-str/rindex.t index 4895859555..b7fd2b84af 100644 --- a/S32-str/rindex.t +++ b/S32-str/rindex.t @@ -42,11 +42,8 @@ is(rindex("Hello", "", 999), 5, "Substr is empty, pos > length of str"); # More difficult strings is(rindex("abcdabcab", "abcd"), 0, "Start-of-substr matches several times"); - -#?rakudo 3 skip 'unicode' is(rindex("uuúuúuùù", "úuù"), 4, "Accented chars"); is(rindex("Ümlaut", "Ü"), 0, "Umlaut"); - is(rindex("what are these « » unicode characters for ?", "uni"), 19, "over unicode characters"); # .rindex use diff --git a/S32-str/split.t b/S32-str/split.t index 29ddaea8d5..48ccedbb18 100644 --- a/S32-str/split.t +++ b/S32-str/split.t @@ -116,7 +116,7 @@ is "".split(':').elems, 1, q/"".split(':')/; is "a.b".split(/\./).join(','), .join(','), q{"a.b".split(/\./)}; -#?rakudo skip 'loops on zero-width match' +#?rakudo skip 'No such method null for invocant of type Cursor' #?niecza skip 'Unable to resolve method null in class Cursor' { is "abcd".split(//).join(','), .join(','), @@ -136,7 +136,7 @@ is "a.b".split(/\./).join(','), .join(','), } # RT #63066 -#?rakudo skip 'RT #63066 loops forever' +#?rakudo todo 'still incorrect' { #?niecza todo 'has initial empty element' is 'hello-world'.split(//).join(','), .join(','), diff --git a/S32-str/uc.t b/S32-str/uc.t index 9ba3187c25..9439df3eb7 100644 --- a/S32-str/uc.t +++ b/S32-str/uc.t @@ -45,7 +45,6 @@ is(uc("ß"), "SS", "uc() of non-ascii chars may result in two chars"); } is ~(0.uc), ~0, '.uc on Int'; -#?rakudo skip 'tc' is ~(0.tc), ~0, '.tc on Int'; is ~(0.lc), ~0, '.lc on Int'; diff --git a/S32-trig/cosec.t b/S32-trig/cosec.t index 696a1faa1b..8be9b33a42 100644 --- a/S32-trig/cosec.t +++ b/S32-trig/cosec.t @@ -5,6 +5,8 @@ use v6; use Test; +plan 114; + sub degrees-to-radians($x) { $x * (312689/99532) / 180; }