Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
warning suppression, mostly "not used"
  • Loading branch information
TimToady committed Sep 3, 2012
1 parent e6ba01a commit 89f0409
Show file tree
Hide file tree
Showing 23 changed files with 36 additions and 36 deletions.
4 changes: 2 additions & 2 deletions S02-types/subset.t
Expand Up @@ -192,7 +192,7 @@ lives_ok { my Bug::RT80930 $rt80930 }, 'subset with "::" in the name';
#?niecza skip 'Methods must be used in some kind of package'
{
subset FooStr of Str where /^foo/;
multi method uc(FooStr $self:) { return "OH HAI" };
my multi method uc(FooStr $self:) { return "OH HAI" }; #OK not used
is "foo".uc, 'FOO', 'multi method with subset invocants do not magically find their way into the method dispatch';

}
Expand All @@ -204,7 +204,7 @@ my $a = 1;
my $a = 3;
sub producer {
my $a = 2;
sub bar($x where $a ) { $x }
sub bar($x where $a ) { $x } #OK not used
}
my &bar := producer();
lives_ok { bar(2) }, 'where-constraint picks up the right lexical (+)';
Expand Down
2 changes: 1 addition & 1 deletion S03-binding/scalars.t
Expand Up @@ -159,7 +159,7 @@ eval_dies_ok '0 := 1', 'cannot bind to a literal';
# RT #89484
{
my $x = 5;
sub f($y) { $x := 5 }
sub f($y) { $x := 5 } #OK not used
f($x);
is $x, 5, 'interaction between signature binding and ordinary binding';
}
Expand Down
4 changes: 2 additions & 2 deletions S03-operators/assign.t
Expand Up @@ -907,7 +907,7 @@ sub l () { 1, 2 };
{
class A {};
my $x = ['a'];
multi infix:<=> (A $a, Str $value) { $x.push: $value; }
multi infix:<=> (A $a, Str $value) { $x.push: $value; } #OK not used
(A.new() = 'b');
is $x.join(','), 'a,b', 'New multi infix:<=> works';
$x = 'c';
Expand All @@ -918,7 +918,7 @@ sub l () { 1, 2 };
# RT #77142
{
my $cc = 0;
sub called($ignored) {
sub called($ignored) { #OK not used
$cc = 1;
};

Expand Down
2 changes: 1 addition & 1 deletion S03-operators/nesting.t
Expand Up @@ -14,7 +14,7 @@ is sort( &[<=>], <5 3 2 1 4> ), <1 2 3 4 5>, 'sort works using &[<=>]';

#?niecza skip 'undeclared name [+]'
is &[+](1, 2), 3, '&[+] as a function';
is 1 [+] 2, 3, '[+] as an infix';
is 1 [+] 2, 3, '[+] as an infix'; #OK Useless

# test nesting with Rop -- tests stolen from reverse.t and nested in various ways

Expand Down
2 changes: 1 addition & 1 deletion S04-exceptions/fail.t
Expand Up @@ -65,7 +65,7 @@ plan 13;

{
class AnEx is Exception { };
my $f = (sub f { fail AnEx.new }).();
my $f = (sub f { fail AnEx.new }).(); #OK not used
isa_ok $f.exception, AnEx, 'can fail() typed exceptions';
}

Expand Down
2 changes: 1 addition & 1 deletion S05-grammar/protoregex.t
Expand Up @@ -78,7 +78,7 @@ grammar LTM {

proto token declok {*}
token declok:sym<a> {
:my $x := 42;
:my $x := 42; #OK not used
.+
}
token declok:sym<b> { aa }
Expand Down
2 changes: 1 addition & 1 deletion S05-mass/rx.t
Expand Up @@ -3,7 +3,7 @@ use Test;
plan 733;

### for now
sub matchcheck(*@a) { 1 }
sub matchcheck(*@) { 1 }

# L<S05/Backtracking control/"To force the preceding atom to do no
# backtracking">
Expand Down
7 changes: 3 additions & 4 deletions S05-match/capturing-contexts.t
Expand Up @@ -42,8 +42,8 @@ plan 38;
#?niecza skip 'rule declaration outside of grammar'
{
augment class Match { method keys () {return %(self).keys }; };
rule a {H};
"Hello" ~~ /<a>/;
my rule a {H};
"Hello" ~~ /<a=&a>/;
is $/.keys, 'a', 'get rule result';
my $x = $/;
is $x.keys, 'a', 'match copy should be same as match';
Expand Down Expand Up @@ -118,9 +118,8 @@ is_run( q{'aa' ~~ /(.)$1/},
}

# RT #72956
#?niecza skip 'Unsupported use of $/ variable as input record separator'
{
$/ = Any;
$/ := Any;
lives_ok { $0 },
'$0 accessible when $/ is undefined';
ok $0 === Any,
Expand Down
2 changes: 1 addition & 1 deletion S06-macros/quasi-blocks.t
Expand Up @@ -57,7 +57,7 @@ plan 12;
# macro defined as an operator, and used as one

{
macro infix:<comet>($rhs, $lhs) {
macro infix:<comet>($rhs, $lhs) { #OK not used
quasi { "comet!" }
}

Expand Down
2 changes: 1 addition & 1 deletion S06-multi/lexical-multis.t
Expand Up @@ -56,7 +56,7 @@ dies_ok { eval("waz('vtak')") }, '...but lexical multi no longer callable';

# RT #78208
{
dies_ok { multi foo() { }; multi foo($x) { }; +&foo }, 'RT #78208'
dies_ok { multi foo() { }; multi foo($x) { }; +&foo }, 'RT #78208'; #OK not used
}

# vim: ft=perl6 :
4 changes: 2 additions & 2 deletions S06-multi/positional-vs-named.t
Expand Up @@ -64,8 +64,8 @@ is( wind('f', 'g', her => 3), 'pos f pos g her 3', 'pos, pos, named');
#?rakudo skip 'slurpy and named interaction'
{
# a nom bug
multi catch(*@all ) { 1 }
multi catch(*@all, :$really! ) { 2 }
multi catch(*@all ) { 1 } #OK not used
multi catch(*@all, :$really! ) { 2 } #OK not used
is catch(0, 5), 1, 'slurpy and named interact well (1)';
is catch(0, 5, :!really), 2, 'slurpy and named interact well (2)';
}
Expand Down
8 changes: 4 additions & 4 deletions S06-multi/proto.t
Expand Up @@ -5,10 +5,10 @@ plan 17;
# Test for proto definitions
class A { }
class B { }
proto foo($x) { * }
multi foo(A $x) { 2 }
multi foo(B $x) { 3 }
multi foo($x) { 1 }
proto foo($x) { * } #OK not used
multi foo(A $x) { 2 } #OK not used
multi foo(B $x) { 3 } #OK not used
multi foo($x) { 1 } #OK not used
is(foo(A.new), 2, 'dispatch on class worked');
is(foo(B.new), 3, 'dispatch on class worked');
is(foo(42), 1, 'dispatch with no possible candidates fell back to proto');
Expand Down
4 changes: 2 additions & 2 deletions S06-multi/type-based.t
Expand Up @@ -205,8 +205,8 @@ is(mmd(1..3), 2, 'Slurpy MMD to listop via list');
#?niecza skip 'no native types yet'
{
# This once wrongly reported a multi-dispatch circularity.
multi rt107638(int $a) { 'ok' }
multi rt107638(Str $a where 1) { }
multi rt107638(int $a) { 'ok' } #OK not used
multi rt107638(Str $a where 1) { } #OK not used
ok rt107638(1), 'native types and where clauses do not cause spurious circularities';
}

Expand Down
4 changes: 2 additions & 2 deletions S06-multi/value-based.t
Expand Up @@ -35,14 +35,14 @@ plan 12;
# RT #88562
{
multi m3(0 , $ ) { 'a' };
multi m3(Int $n, Str $a = 'A') { 'b' };
multi m3(Int $n, Str $a = 'A') { 'b' }; #OK not used

is m3(2, 'A'), 'b', 'literal Int, anonymous parameters and default values mix';
}

{
multi sub foo(0, $) { 'B' };
multi sub foo(Int $n, Str $a="A") { $a };
multi sub foo(Int $n, Str $a="A") { $a }; #OK not used
is foo(2,"A"), 'A', 'Literals and optionals mix';
}

Expand Down
5 changes: 3 additions & 2 deletions S06-operator-overloading/sub.t
Expand Up @@ -94,7 +94,7 @@ Testing operator overloading subroutines
}
{
sub infix:«_<_ »($one, $two) { return 42 }
sub infix:«_<_ »($one, $two) { return 42 } #OK not used
is 3 _<_ 5, 42, "frenchquoted infix sub";
}
Expand Down Expand Up @@ -218,12 +218,13 @@ Testing operator overloading subroutines
class MyClass {
method prefix:<~> is export { "hi" }
method prefix:<+> is export { 42 }
method infix:<as>($self, OtherClass $to) is export {
method infix:<as>($self: OtherClass $to) is export { #OK not used
my $obj = $to.new;
$obj.x = 23;
return $obj;
}
}
import MyClass; # should import that sub forms of the exports
my $obj;
lives_ok { $obj = MyClass.new }, "instantiation of a prefix:<...> and infix:<as> overloading class worked";
Expand Down
4 changes: 2 additions & 2 deletions S06-signature/arity.t
Expand Up @@ -147,7 +147,7 @@ dies_ok { eval("a_zero( 'hello', 'world' )") }, 'no matching sub signature';

# RT #111646
#?pugs 2 skip '.count'
is (-> *@a { }).count, Inf, 'slurpy positional causes infinite count';
is (-> *%a { }).count, 0, 'slurpy named causes no count change';
is (-> *@a { }).count, Inf, 'slurpy positional causes infinite count'; #OK not used
is (-> *%a { }).count, 0, 'slurpy named causes no count change'; #OK not used

# vim: ft=perl6
2 changes: 1 addition & 1 deletion S06-signature/optional.t
Expand Up @@ -93,7 +93,7 @@ eval_dies_ok 'sub opt($a = 1, $b) { }',
sub opt-type1(Int $x?) { $x };
ok opt-type1() === Int,
'optional param with type constraints gets the right value';
sub opt-type2(Int $x = 'str') { };
sub opt-type2(Int $x = 'str') { }; #OK not used
dies_ok { eval('opt-type2()') }, 'default values are type-checked';
}

Expand Down
2 changes: 1 addition & 1 deletion S06-traits/is-copy.t
Expand Up @@ -87,7 +87,7 @@ plan 22;

# RT #74454
{
sub g(%hash? is copy) { };
sub g(%hash? is copy) { }; #OK not used
lives_ok { g() }, 'can call a sub with an optional "is copy" hash param';
}

Expand Down
2 changes: 1 addition & 1 deletion S12-introspection/definite.t
Expand Up @@ -24,4 +24,4 @@ class C {
method DEFINITE() { True }
}
is C.DEFINITE, False, "Class declaring DEFINITE method doesn't influence .DEFINITE macro";
is C."DEFINITE"(), True, "Quoting lets us call the method, however";
is C."DEFINITE"(), True, "Quoting lets us call the method, however"; #OK Useless
2 changes: 1 addition & 1 deletion S12-methods/private.t
Expand Up @@ -86,7 +86,7 @@ dies_ok {$o."b"() }, 'can not call private method via quotes from outside'; #
class RT101964 {
has @!c;
method foo { self!bar(@!c) }
method !bar(@r) {
method !bar(@r) { #OK not used
'OH HAI';
}
}
Expand Down
2 changes: 1 addition & 1 deletion S14-traits/routines.t
Expand Up @@ -55,7 +55,7 @@ plan 12;
# RT 112664
{
multi trait_mod:<is>($m, :$a!) {
multi y(|) { my $x = $m }
multi y(|) { my $x = $m } #OK not used
$m.wrap(&y)
}
sub rt112664 is a {}
Expand Down
2 changes: 1 addition & 1 deletion S16-filehandles/filetest.t
Expand Up @@ -112,7 +112,7 @@ unlink "empty_file";

# potential parsing difficulties (pugs)
{
sub f($x) { return 8; }
sub f($) { return 8; }

is(f($*PROGRAM_NAME), 8, "f(...) works");
is(-f($*PROGRAM_NAME), -8, "- f(...) does not call the ~~:f filetest");
Expand Down
2 changes: 1 addition & 1 deletion S32-list/reduce.t
Expand Up @@ -65,7 +65,7 @@ eval_lives_ok( 'reduce -> $a, $b, $c? { $a + $b * ($c//1) }, 1, 2', 'Use proper
# RT #66352
{
multi a (Str $a, Str $b) { [+$a, +$b] };
multi a (Array $a,$b where "+") { [+] @($a) };
multi a (Array $a,$b where "+") { [+] @($a) }; #OK not used
is ("1", "2", "+").reduce(&a), 3, 'reduce and multi subs';
}

Expand Down

0 comments on commit 89f0409

Please sign in to comment.