Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Replace some more eval-dies-ok with throws-like
  • Loading branch information
usev6 committed Sep 24, 2015
1 parent a851e2d commit 8361bcd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions S05-metasyntax/changed.t
Expand Up @@ -30,9 +30,9 @@ plan 12;

# The \A, \Z, and \z metacharacters are gone.
{
eval-dies-ok('/\A/', '\\A is gone');
eval-dies-ok('/\Z/', '\\Z is gone');
eval-dies-ok('/\z/', '\\z is gone');
throws-like '/\A/', X::Obsolete, '\\A is gone';
throws-like '/\Z/', X::Obsolete, '\\Z is gone';
throws-like '/\z/', X::Obsolete, '\\z is gone';
}

# vim: ft=perl6
8 changes: 5 additions & 3 deletions S05-substitution/subst.t
Expand Up @@ -232,8 +232,10 @@ is '12'.subst(/(.)(.)/,{$()*2}),'24', '.. and do nifty things in closures';
}

{
eval-dies-ok '$_ = "a"; s:unkonwn/a/b/', 's/// dies on unknown adverb';
eval-dies-ok '$_ = "a"; s:overlap/a/b/', ':overlap does not make sense on s///';
throws-like '$_ = "a"; s:unkonwn/a/b/', X::Syntax::Regex::Adverb,
's/// dies on unknown adverb';
throws-like '$_ = "a"; s:overlap/a/b/', X::Syntax::Regex::Adverb,
':overlap does not make sense on s///';
}

# note that when a literal is passed to 'given', $_ is bound read-only
Expand Down Expand Up @@ -394,7 +396,7 @@ is '12'.subst(/(.)(.)/,{$()*2}),'24', '.. and do nifty things in closures';

{
#?niecza todo "Niecza works when it shouldn't?"
eval-dies-ok q[ $_ = "abc"; my $i = 1; s:i($i)/a/b/ ],
throws-like q[ $_ = "abc"; my $i = 1; s:i($i)/a/b/ ], X::Value::Dynamic,
'Value of :i must be known at compile time';
#?rakudo todo 'be smarter about constant detection'
eval-lives-ok q[ $_ = "abc";s:i(1)/a/b/ ],
Expand Down
2 changes: 1 addition & 1 deletion S05-transliteration/trans.t
Expand Up @@ -232,7 +232,7 @@ is(" <>&".trans(:c, :s, ([' ', '>', '&'] =>
}

# y/// is dead
eval-dies-ok('$_ = "axbycz"; y/abc/def/', 'y/// does not exist any longer');
throws-like '$_ = "axbycz"; y/abc/def/', X::Obsolete, 'y/// does not exist any longer';

# RT #71088
{
Expand Down
4 changes: 2 additions & 2 deletions S06-signature/errors.t
Expand Up @@ -13,8 +13,8 @@ These are misc. sub argument errors.
sub bar (*@x) { 1 } #OK not used
lives-ok { bar(reverse(1,2)) }, 'slurpy args are not bounded (2)';

eval-dies-ok 'sub quuux ($?VERSION) { ... }',
'parser rejects magicals as args (1)';
throws-like 'sub quuux ($?VERSION) { ... }', X::Parameter::Twigil,
'parser rejects magicals as args (1)';
eval-lives-ok 'sub quuuux ($!) { ... }', 'but $! is OK';

# RT #64344
Expand Down

0 comments on commit 8361bcd

Please sign in to comment.