Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
s/eval_dies_ok/eval-dies-ok/g
  • Loading branch information
lizmat committed May 19, 2015
1 parent b19b0bf commit 0cbc065
Show file tree
Hide file tree
Showing 133 changed files with 363 additions and 363 deletions.
2 changes: 1 addition & 1 deletion S02-lexical-conventions/comments.t
Expand Up @@ -140,7 +140,7 @@ plan 51;
# NB: This is as it should be. The inside is not parsed till EVAL time.
# Interpolation happens before that. --law

eval_dies_ok " #`<<\n comment\n # >>\n >> 3",
eval-dies-ok " #`<<\n comment\n # >>\n >> 3",
'single line comment in multiline does not hide delims';
}

Expand Down
8 changes: 4 additions & 4 deletions S02-types/lists.t
Expand Up @@ -26,10 +26,10 @@ plan 32;

is ($foo, "does_not_matter")[*-2], 42,
"indexing lists by a negative index works correctly";
eval_dies_ok q/sub foo { @_[-1] }/, "indexing lists by explicit negative index is parsefail (compact)";
eval_dies_ok q/sub foo { @_[ -42 ] }/, "indexing lists by explicit negative index is parsefail (spaced)";
eval_dies_ok q/sub foo { @_[0..-1] }/, "indexing lists by range ending with negative index is parsefail (compact)";
eval_dies_ok q/sub foo { @_[ 0 .. -42 ] }/, "indexing lists by range ending with negative index is parsefail (spaced)";
eval-dies-ok q/sub foo { @_[-1] }/, "indexing lists by explicit negative index is parsefail (compact)";
eval-dies-ok q/sub foo { @_[ -42 ] }/, "indexing lists by explicit negative index is parsefail (spaced)";
eval-dies-ok q/sub foo { @_[0..-1] }/, "indexing lists by range ending with negative index is parsefail (compact)";
eval-dies-ok q/sub foo { @_[ 0 .. -42 ] }/, "indexing lists by range ending with negative index is parsefail (spaced)";
throws-like { EVAL q/my @a = <one two>; @a[*-3] = 'zero'/ },
X::OutOfRange,
"indexing lists by an effective negative index with * dies";
Expand Down
12 changes: 6 additions & 6 deletions S02-types/type.t
Expand Up @@ -43,7 +43,7 @@ my Str $bar;
#?niecza skip 'native types (noauto)'
{
eval_lives_ok('my int $alpha = 1', 'Has native type int');
eval_dies_ok('my int $alpha = Nil', 'native int type cannot be undefined');
eval-dies-ok('my int $alpha = Nil', 'native int type cannot be undefined');
lives_ok({my Int $beta = Nil}, 'object Int type can be undefined');
eval_lives_ok('my num $alpha = 1e0', 'Has native type num');
#?rakudo.jvm todo "nigh"
Expand All @@ -59,7 +59,7 @@ my Str $bar;
{
sub paramtype (Int $i) {return $i+1}
is(paramtype(5), 6, 'sub parameters with matching type');
eval_dies_ok('paramtype("foo")', 'sub parameters with non-matching type dies');
eval-dies-ok('paramtype("foo")', 'sub parameters with non-matching type dies');
}

{
Expand Down Expand Up @@ -126,10 +126,10 @@ dies_ok { my Num $n; $n = 42; }, 'Num does not accept Int';
}

{
eval_dies_ok('my Int Str $x', 'multiple prefix constraints not allowed');
eval_dies_ok('sub foo(Int Str $x) { }', 'multiple prefix constraints not allowed');
eval_dies_ok('sub foo(--> Int Str) { }', 'multiple prefix constraints not allowed');
eval_dies_ok('our Int Str sub foo() { }', 'multiple prefix constraints not allowed');
eval-dies-ok('my Int Str $x', 'multiple prefix constraints not allowed');
eval-dies-ok('sub foo(Int Str $x) { }', 'multiple prefix constraints not allowed');
eval-dies-ok('sub foo(--> Int Str) { }', 'multiple prefix constraints not allowed');
eval-dies-ok('our Int Str sub foo() { }', 'multiple prefix constraints not allowed');
}

{
Expand Down
2 changes: 1 addition & 1 deletion S02-types/whatever.t
Expand Up @@ -219,7 +219,7 @@ is (0,0,0,0,0,0) >>+>> ((1,2) xx *).flat, <1 2 1 2 1 2>, 'xx * works';
# RT #73162
# WAS: eval_lives_ok '{*.{}}()', '{*.{}}() lives';
# This is now supposed tobe a double-closure error:
eval_dies_ok '{*.{}}()', '{*.{}}() dies';
eval-dies-ok '{*.{}}()', '{*.{}}() dies';

# RT #80256
{
Expand Down
2 changes: 1 addition & 1 deletion S03-binding/arrays.t
Expand Up @@ -227,7 +227,7 @@ plan 47;
# RT #61566
#?niecza todo
{
eval_dies_ok 'my @rt61566 := 1', 'can only bind Positional stuff to @a';
eval-dies-ok 'my @rt61566 := 1', 'can only bind Positional stuff to @a';
# TODO: check that the error is the right one
# <pmichaud> you should get a "Int does not do Positional role"
# exception or something like that.
Expand Down
2 changes: 1 addition & 1 deletion S03-binding/hashes.t
Expand Up @@ -180,7 +180,7 @@ plan 39;
is ~%hash\ .values.sort, "a c", 'binding %hash := $hashref works (3)';
}

eval_dies_ok 'my %h = a => 1, b => 2; %h<a b> := (4, 5)',
eval-dies-ok 'my %h = a => 1, b => 2; %h<a b> := (4, 5)',
'Cannot bind to hash slices';
is 1,1, 'dummy';

Expand Down
2 changes: 1 addition & 1 deletion S03-binding/scalars.t
Expand Up @@ -36,7 +36,7 @@ plan 33;
}

# RT #77594
eval_dies_ok '0 := 1', 'cannot bind to a literal';
eval-dies-ok '0 := 1', 'cannot bind to a literal';


# Binding and $CALLER::
Expand Down
2 changes: 1 addition & 1 deletion S03-feeds/basic.t
Expand Up @@ -64,7 +64,7 @@ plan 24;
my @data = <1 2 4 5 7 8>;
my @odds = <1 5 7>;

eval_dies_ok('@data <== grep {$_ % 2} <== @data', 'a chain of feeds may not begin and end with the same array');
eval-dies-ok('@data <== grep {$_ % 2} <== @data', 'a chain of feeds may not begin and end with the same array');

@data = <1 2 4 5 7 8>;
@data <== grep {$_ % 2} <== eager @data;
Expand Down
4 changes: 2 additions & 2 deletions S03-metaops/cross.t
Expand Up @@ -71,7 +71,7 @@ is (1,2 X* 3,4), (3,4,6,8), 'cross-product works';
is (1,2 Xcmp 3,2,0), (Order::Less, Order::Less, Order::More, Order::Less, Order::Same, Order::More), 'Xcmp works';

# L<S03/Cross operators/underlying operator non-associating>
eval_dies_ok '@result Xcmp @expected Xcmp <1 2>',
eval-dies-ok '@result Xcmp @expected Xcmp <1 2>',
'non-associating ops cannot be cross-ops';

# let's have some fun with X..., comparison ops and junctions:
Expand Down Expand Up @@ -124,7 +124,7 @@ is (1,2 X ( <a b> X "x")).flat.join, '1a1x1b1x2a2x2b2x',

# RT #77114
{
eval_dies_ok 'my %foo XX= 1', "cross doesn't handle assignment";
eval-dies-ok 'my %foo XX= 1', "cross doesn't handle assignment";
}

# RT #120973
Expand Down
2 changes: 1 addition & 1 deletion S03-metaops/hyper.t
Expand Up @@ -818,7 +818,7 @@ is ((1, 2) >>[+]<< (100, 200)).join(','), '101,202',
# RT #77114
{
#?rakudo todo "can_meta check for meta operators NYI"
eval_dies_ok 'my @a >>[=]>> (1,2,3)', "hypering assignment dies correctly";
eval-dies-ok 'my @a >>[=]>> (1,2,3)', "hypering assignment dies correctly";
}

# RT #123178
Expand Down
2 changes: 1 addition & 1 deletion S03-metaops/not.t
Expand Up @@ -50,7 +50,7 @@ isa-ok 4 !=:= 5, Bool, "4 !=:= 5 is Bool";

# Tests based on http://irclog.perlgeek.de/perl6/2012-01-24#i_5045770
# and the next few minutes of log. --colomon
eval_dies_ok '"a" !!eq "a"', 'Doubled prefix:<!> is illegal';
eval-dies-ok '"a" !!eq "a"', 'Doubled prefix:<!> is illegal';
ok "a" ![!eq] "a", '![!eq] is legal and works (1)';
nok "a" ![!eq] "b", '![!eq] is legal and works (2)';

Expand Down
4 changes: 2 additions & 2 deletions S03-metaops/reverse.t
Expand Up @@ -58,11 +58,11 @@ is 4 R- 5 R/ 10, -2, "Rop gets the precedence of op";
is (9 R... 1, 3), (1, 3, 5, 7, 9), "Rop gets list_infix precedence correctly";

# RT #93350
eval_dies_ok '("a" R~ "b") = 1', 'Cannot assign to return value of R~';
eval-dies-ok '("a" R~ "b") = 1', 'Cannot assign to return value of R~';

# RT #77114
{
eval_dies_ok '1 R= my $x', "R doesn't handle assignment";
eval-dies-ok '1 R= my $x', "R doesn't handle assignment";
}

# RT #118793
Expand Down
2 changes: 1 addition & 1 deletion S03-metaops/zip.t
Expand Up @@ -85,7 +85,7 @@ is (1, 2 Z, 3, 4).flat.join('|'), '1|3|2|4', 'Z, flattens in list context';

# RT #77114
{
eval_dies_ok 'my @a Z= 1,2,3', "zip doesn't handle assignment";
eval-dies-ok 'my @a Z= 1,2,3', "zip doesn't handle assignment";
}

{
Expand Down
2 changes: 1 addition & 1 deletion S03-operators/assign.t
Expand Up @@ -375,7 +375,7 @@ my @p;

# RT #64818
{
eval_dies_ok q{my $foo = 'foo'; $foo R~= 'foo';},
eval-dies-ok q{my $foo = 'foo'; $foo R~= 'foo';},
'use of R~= operator on a non-container dies';
my ($x, $y) = <a b>; $x R~= $y;
is("$x $y", "a ba", "R~= operator works");
Expand Down
2 changes: 1 addition & 1 deletion S03-operators/autoincrement.t
Expand Up @@ -192,7 +192,7 @@ is(%z{0}, $base, '%z{0}');
}

# RT #63644
eval_dies_ok 'my $a; $a++ ++;', 'parse error for "$a++ ++"';
eval-dies-ok 'my $a; $a++ ++;', 'parse error for "$a++ ++"';

# RT #99731
{
Expand Down
2 changes: 1 addition & 1 deletion S03-operators/chained-declarators.t
Expand Up @@ -19,7 +19,7 @@ is((try { my $a5 = state $b5 = 42; $b5++; "$a5, $b5" }), '42, 43', "chained my,

# scoping

eval_dies_ok '
eval-dies-ok '
{
our $sa2 = my $sb2 = 42;
}
Expand Down
8 changes: 4 additions & 4 deletions S03-operators/context.t
Expand Up @@ -72,21 +72,21 @@ plan 38;
ok(%('a', 1, 'b', 2) eqv {a => 1, b => 2}, '%(values) builds a hash');
ok(hash('a', 1, 'b', 2) eqv {a => 1, b => 2}, 'hash(values) builds a hash');
ok((hash 'a', 1, 'b', 2) eqv {a => 1, b => 2}, 'hash values builds a hash');
eval_dies_ok('hash("a")', 'building a hash of one item fails');
eval-dies-ok('hash("a")', 'building a hash of one item fails');
}

# L<S03/"Changes to Perl 5 operators"/Perl 5's ${...}, @{...}, %{...}, etc>
# ^ non-breaking space
# Deprecated P5 dereferencing operators:
{
my $scalar = 'abcd';
eval_dies_ok('${$scalar}', 'Perl 5 form of ${$scalar} dies');
eval-dies-ok('${$scalar}', 'Perl 5 form of ${$scalar} dies');

my $array = [1, 2, 3];
eval_dies_ok('@{$array}', 'Perl 5 form of @{$array} dies');
eval-dies-ok('@{$array}', 'Perl 5 form of @{$array} dies');

my $hash = {a => 1, b => 2, c => 3};
eval_dies_ok('%{$hash}', 'Perl 5 form of %{$hash} dies');
eval-dies-ok('%{$hash}', 'Perl 5 form of %{$hash} dies');
}

is(($).WHAT.gist, '(Any)', 'Anonymous $ variable can be declared');
Expand Down
2 changes: 1 addition & 1 deletion S03-operators/fiddly.t
Expand Up @@ -7,5 +7,5 @@ plan 1;

my $fiddly_code = 'my ($a, $b) = (1,2); my @c = [=] $a, $b;';

eval_dies_ok $fiddly_code , 'dies on fiddly code';
eval-dies-ok $fiddly_code , 'dies on fiddly code';

20 changes: 10 additions & 10 deletions S03-operators/increment.t
Expand Up @@ -70,16 +70,16 @@ is($moo, 0, "var was not touched");
}

# test incrementing literals
# all of those can be detected at compile time, so use eval_dies_ok here
# all of those can be detected at compile time, so use eval-dies-ok here
{
eval_dies_ok ' 4++ ', "can't postincrement a literal number";
eval_dies_ok ' ++4 ', "can't preincrement a literal number";
eval_dies_ok ' 4-- ', "can't postdecrement a literal number";
eval_dies_ok ' --4 ', "can't predecrement a literal number";
eval_dies_ok ' "x"++ ', "can't postincrement a literal string";
eval_dies_ok ' ++"x" ', "can't preincrement a literal string";
eval_dies_ok ' "x"-- ', "can't postdecrement a literal string";
eval_dies_ok ' --"x" ', "can't predecrement a literal string";
eval-dies-ok ' 4++ ', "can't postincrement a literal number";
eval-dies-ok ' ++4 ', "can't preincrement a literal number";
eval-dies-ok ' 4-- ', "can't postdecrement a literal number";
eval-dies-ok ' --4 ', "can't predecrement a literal number";
eval-dies-ok ' "x"++ ', "can't postincrement a literal string";
eval-dies-ok ' ++"x" ', "can't preincrement a literal string";
eval-dies-ok ' "x"-- ', "can't postdecrement a literal string";
eval-dies-ok ' --"x" ', "can't predecrement a literal string";
}

# this used to be a rakudo regression
Expand Down Expand Up @@ -118,7 +118,7 @@ is($moo, 0, "var was not touched");

# RT #74912
#?niecza todo 'Works fine in niecza...'
eval_dies_ok 'my $x = 0; ++++$x',
eval-dies-ok 'my $x = 0; ++++$x',
'can not double-increment, because the return value is not a container';

{
Expand Down
2 changes: 1 addition & 1 deletion S03-operators/precedence.t
Expand Up @@ -205,7 +205,7 @@ is(@c, [1,2,3], "@ = binds looser than ,");
is (uc "a" eq "A"), uc(False.Str), "uc has the correct precedence in comparison to eq";

# L<S03/Named unary precedence/my $i = int $x; # ILLEGAL>
eval_dies_ok 'int 4.5', 'there is no more prefix:<int>';
eval-dies-ok 'int 4.5', 'there is no more prefix:<int>';


# http://irclog.perlgeek.de/perl6/2009-07-14#i_1315249
Expand Down
2 changes: 1 addition & 1 deletion S03-operators/range.t
Expand Up @@ -255,7 +255,7 @@ is ~(2 .. [<a b c d e>]), "2 3 4 5", '2 .. @list is legal';
}

# RT #77572
eval_dies_ok '1..2..3', '.. is not associative';
eval-dies-ok '1..2..3', '.. is not associative';

{
## once this block died at compile time
Expand Down
4 changes: 2 additions & 2 deletions S03-operators/subscript-vs-lt.t
Expand Up @@ -16,7 +16,7 @@ plan 4;

eval_lives_ok "1 <2", "infix less-than (<) requires whitespace before.";
eval_lives_ok "1 < 2" , "infix less-than (<) requires whitespace before.";
eval_dies_ok("1< 2", "infix less-than (<) requires whitespace before, so this is a parse error.");
eval_dies_ok("1<2", "infix less-than (<) requires whitespace before, so this is a parse error.");
eval-dies-ok("1< 2", "infix less-than (<) requires whitespace before, so this is a parse error.");
eval-dies-ok("1<2", "infix less-than (<) requires whitespace before, so this is a parse error.");

# vim: ft=perl6
2 changes: 1 addition & 1 deletion S03-operators/ternary.t
Expand Up @@ -70,7 +70,7 @@ is((4 or 5 ?? 6 !! 7), 4, "operator priority");
'Ternary error (RT 66840)';
}

eval_dies_ok q[ 71704 !! 'bust' ], 'Ternary error (RT 71704)';
eval-dies-ok q[ 71704 !! 'bust' ], 'Ternary error (RT 71704)';

throws-like { EVAL '1 ?? 3 :: 2' },
X::Syntax::ConditionalOperator::SecondPartInvalid,
Expand Down
2 changes: 1 addition & 1 deletion S03-sequence/basic.t
Expand Up @@ -242,7 +242,7 @@ is (5,4,3, { $_ - 1 || last } ... *)[^10].join(', '), '5, 4, 3, 2, 1', "sequence
}

# RT #75828
eval_dies_ok '1, 2, 3, ... 5', 'comma before sequence operator is caught';
eval-dies-ok '1, 2, 3, ... 5', 'comma before sequence operator is caught';

# RT #73268
is ~(1...^*).[^10], '1 2 3 4 5 6 7 8 9 10', 'RT #73268';
Expand Down
2 changes: 1 addition & 1 deletion S03-sequence/misc.t
Expand Up @@ -32,7 +32,7 @@ is ('a', 'b', 'c', { $^x ~ 'x', $^y ~ 'y' ~ $^z ~ 'z' } ... *)[^9].join(' '), 'a

# L<S03/List infix precedence/it will be taken as a yada>

eval_dies_ok '(1, 2, ... 3)[2]', 'yada operator not confused for sequence operator'; #OK apparent sequence operator
eval-dies-ok '(1, 2, ... 3)[2]', 'yada operator not confused for sequence operator'; #OK apparent sequence operator

# L<S03/List infix precedence/and another function to continue the list>
# chained sequence
Expand Down
2 changes: 1 addition & 1 deletion S04-blocks-and-statements/pointy.t
Expand Up @@ -78,7 +78,7 @@ is $str, 'inner', 'return in pointy returns from enclosing sub';

# -> { $^a, $^b } is illegal; you can't mix real sigs with placeholders,
# and the -> introduces a sig of (). TimToady #perl6 2008-May-24
eval_dies_ok(q{{ -> { $^a, $^b } }}, '-> { $^a, $^b } is illegal');
eval-dies-ok(q{{ -> { $^a, $^b } }}, '-> { $^a, $^b } is illegal');

# RT #61034
lives_ok {my $x = -> {}; my $y = $x(); },
Expand Down
2 changes: 1 addition & 1 deletion S04-declarations/constant.t
Expand Up @@ -32,7 +32,7 @@ plan 56;

# RT #69740
{
eval_dies_ok 'constant ($a, $b) = (3, 4)', 'constant no longer takes list';
eval-dies-ok 'constant ($a, $b) = (3, 4)', 'constant no longer takes list';
}

{
Expand Down
4 changes: 2 additions & 2 deletions S04-declarations/implicit-parameter.t
Expand Up @@ -43,13 +43,13 @@ plan 19;
is(-> $a { $_ }.(42), 'Ack!', 'Even with parameters');
is(-> $_ { $_ }.(42), 42, 'But not when the parameter is $_');

eval_dies_ok( 'sub () { -> { $^a }.() }', 'Placeholders not allowed in ->');
eval-dies-ok( 'sub () { -> { $^a }.() }', 'Placeholders not allowed in ->');

is(-> { }.arity, 0, '->{} is arity 0, again');
}

{
eval_dies_ok('sub () { $^foo }.(42)', 'Placeholders not allowed in sub()');
eval-dies-ok('sub () { $^foo }.(42)', 'Placeholders not allowed in sub()');
}

# RT #114696
Expand Down
4 changes: 2 additions & 2 deletions S04-declarations/multiple.t
Expand Up @@ -20,10 +20,10 @@ eval_lives_ok 'state $x; state $x',
}

# this is not exactly S04 material
eval_dies_ok 'sub foo {1; }; sub foo($x) {1; };',
eval-dies-ok 'sub foo {1; }; sub foo($x) {1; };',
'multiple declarations need multi or proto';

eval_dies_ok 'only sub foo {1; }; sub foo($x) {1; };',
eval-dies-ok 'only sub foo {1; }; sub foo($x) {1; };',
'multiple declarations need multi or proto';

#?niecza todo "MMD"
Expand Down

0 comments on commit 0cbc065

Please sign in to comment.