Skip to content

Commit

Permalink
Fudges for S32
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Sep 3, 2013
1 parent 3b585fa commit 9028e8c
Show file tree
Hide file tree
Showing 17 changed files with 35 additions and 41 deletions.
6 changes: 2 additions & 4 deletions S32-array/elems.t
Expand Up @@ -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";
}

{
Expand All @@ -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";
}

{
Expand Down
9 changes: 3 additions & 6 deletions S32-array/end.t
Expand Up @@ -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)";
}

{
Expand All @@ -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'
Expand Down
2 changes: 0 additions & 2 deletions S32-exceptions/misc.t
Expand Up @@ -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/<<rx>>// or $()';
throws_like 'qr/a/', X::Obsolete, old => rx/<<qr>>/, replacement => rx/<<rx>>/;
throws_like '"a" . "b"', X::Obsolete, replacement => '~';
throws_like 's/a/b/i', X::Obsolete;
Expand Down
6 changes: 3 additions & 3 deletions S32-hash/exists-adverb.t
Expand Up @@ -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*";
Expand All @@ -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";
Expand All @@ -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";
Expand Down
11 changes: 7 additions & 4 deletions S32-hash/slice.t
Expand Up @@ -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"
{
Expand Down Expand Up @@ -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<foo>, :b<bar>, :c<baz>);

try { %hash<a b> := <FOO BAR> };
Expand All @@ -86,7 +86,7 @@ Quoting Larry:
is %hash<b>, "BAR", "binding hash slices works (1-2)";
}

#?rakudo skip 'binding on hash elements unimplemented'
#?rakudo todo 'binding on hash elements unimplemented'
{ my %hash = (:a<foo>, :b<bar>, :c<baz>);

try { %hash<a b> := <FOO> };
Expand All @@ -96,19 +96,20 @@ Quoting Larry:
ok !defined(%hash<b>), "binding hash slices works (2-2)";
}

#?rakudo skip 'binding on hash elements unimplemented'
{ my %hash = (:a<foo>, :b<bar>, :c<baz>);
my $foo = "FOO";
my $bar = "BAR";

try { %hash<a b> := ($foo, $bar) };
#?rakudo 2 todo 'binding on hash elements unimplemented'
#?pugs 2 todo 'bug'
#?niecza 2 todo
is %hash<a>, "FOO", "binding hash slices works (3-1)";
is %hash<b>, "BAR", "binding hash slices works (3-2)";

$foo = "BB";
$bar = "CC";
#?rakudo 2 todo 'binding on hash elements unimplemented'
#?niecza 2 todo
#?pugs 2 todo 'bug'
is %hash<a>, "BB", "binding hash slices works (3-3)";
Expand All @@ -118,6 +119,8 @@ Quoting Larry:
%hash<b> = "CCC";
is %hash<a>, "BBB", "binding hash slices works (3-5)";
is %hash<b>, "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)";
Expand Down
2 changes: 1 addition & 1 deletion S32-list/reduce.t
Expand Up @@ -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";
}
Expand Down
2 changes: 1 addition & 1 deletion S32-list/sort.t
Expand Up @@ -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
{
Expand Down
10 changes: 5 additions & 5 deletions S32-list/uniq.t
Expand Up @@ -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 = <a b A c b d>;
my @array = <a b d A c b>;
# 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'
Expand Down
4 changes: 2 additions & 2 deletions S32-scalar/undef.t
Expand Up @@ -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
{
Expand Down Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion S32-str/chop.t
Expand Up @@ -3,7 +3,7 @@ use Test;

# L<S32::Str/Str/"=item chop">

plan 12;
plan 6;

#
# Tests already covered by the specs
Expand Down
3 changes: 1 addition & 2 deletions S32-str/comb.t
Expand Up @@ -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';
Expand Down Expand Up @@ -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 (<a ab>, <bc ad ba>).comb(m:Perl5/\S*a\S*/), <a ab ad ba>,
'comb a list';
Expand Down
2 changes: 1 addition & 1 deletion S32-str/flip.t
Expand Up @@ -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, '', "grapheme precomposed" );
is( "a\c[COMBINING DOT ABOVE, COMBINING DOT BELOW]b".flip,
Expand Down
7 changes: 4 additions & 3 deletions S32-str/numeric.t
Expand Up @@ -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;
Expand All @@ -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
Expand Down
3 changes: 0 additions & 3 deletions S32-str/rindex.t
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions S32-str/split.t
Expand Up @@ -116,7 +116,7 @@ is "".split(':').elems, 1, q/"".split(':')/;
is "a.b".split(/\./).join(','), <a b>.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(/<null>/).join(','), <a b c d>.join(','),
Expand All @@ -136,7 +136,7 @@ is "a.b".split(/\./).join(','), <a b>.join(','),
}

# RT #63066
#?rakudo skip 'RT #63066 loops forever'
#?rakudo todo 'still incorrect'
{
#?niecza todo 'has initial empty element'
is 'hello-world'.split(/<ws>/).join(','), <hello - world>.join(','),
Expand Down
1 change: 0 additions & 1 deletion S32-str/uc.t
Expand Up @@ -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';

Expand Down
2 changes: 2 additions & 0 deletions S32-trig/cosec.t
Expand Up @@ -5,6 +5,8 @@
use v6;
use Test;

plan 114;

sub degrees-to-radians($x) {
$x * (312689/99532) / 180;
}
Expand Down

0 comments on commit 9028e8c

Please sign in to comment.