Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

remove bogus test

  • Loading branch information...
commit a238bb3bb791fd6c642759a83c3ade62ccd6c886 1 parent 24927b5
@moritz moritz authored
View
2  S02-literals/sub-calls.t
@@ -28,7 +28,7 @@ plan 20;
ok eval(q/&foo.(1); /), 'call with one arg, has dot and parens';
ok eval(q/&foo\ .(1);/), 'call with one arg, has long dot and parens';
#?pugs todo 'unspecced'
- nok try { eval(q/foo'bar'; /) }, 'call with one arg, has no space and no parens';
+ dies_ok { eval(q/foo'bar'; /) }, 'call with one arg, has no space and no parens';
ok eval(q/foo 1, 2; /), 'call with two args, no parens';
ok eval(q/foo(1, 2);/), 'call with two args, has parens';
View
5 S02-literals/subscript.t
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 3;
+plan 2;
{ # from t/03-operator.t, as noted by afbach on #perl6, 2005-03-06
my @oldval = (5, 8, 12);
@@ -11,8 +11,7 @@ plan 3;
lives_ok({ all(@newval2) < any(@oldval); all(@newval1) > all(@oldval) }, "parses correctly, second statement is true");
my %hash = ("foo", "bar");
- nok try { eval '%hash <foo>; 1'}, '%hash \s+ <subscript> doesnt parse';
- isnt($!,"",'... and it sets $!');
+ dies_ok { eval '%hash <foo>; 1'}, '%hash \s+ <subscript> doesnt parse';
};
# vim: ft=perl6
View
2  S02-names-vars/names.t
@@ -60,7 +60,7 @@ plan 140;
'dies when calling non-existent sub in existing package';
# RT #74520
class TestA { };
- nok try { eval 'TestA::b(3, :foo)'},
+ dies_ok { eval 'TestA::b(3, :foo)'},
'calling non-existing function in foreign class dies';;
#?rakudo todo 'nom regression'
ok "$!" ~~ / ' TestA::b' /, 'error message mentions function name';
View
2  S02-types/hash.t
@@ -191,7 +191,7 @@ is %dupl<a>, 3, "hash creation with duplicate keys works correctly";
}
{
- nok try { eval ' @%(a => <b>)<a>' },
+ dies_ok { eval ' @%(a => <b>)<a>' },
"doesn't really make sense, but shouldn't segfault, either ($!)";
}
View
4 S02-types/subset.t
@@ -18,11 +18,11 @@ subset Even of Int where { $_ % 2 == 0 };
};
-nok try { eval('my Even $x = 3') },
+dies_ok { eval('my Even $x = 3') },
"Can't assign value that violates type constraint via subset";
# RT # 69518'
-nok try { eval('Even.new') }, 'Cannot instantiate a subtype';
+dies_ok { eval('Even.new') }, 'Cannot instantiate a subtype';
{
ok 2 ~~ Even, 'Can smartmatch against subsets 1';
View
2  S05-metasyntax/unknown.t
@@ -27,7 +27,7 @@ lives_ok({"aa!" ~~ /'a'/}, 'quoted "a" is valid');
# RT #74832
{
- nok try {eval('/ a+ + /')}, 'Cannot parse regex a+ +';
+ dies_ok {eval('/ a+ + /')}, 'Cannot parse regex a+ +';
#?rakudo todo 'RT 74832'
ok "$!" ~~ /:i quantif/, 'error message mentions quantif{y,ier}';
}
View
8 S06-multi/lexical-multis.t
@@ -26,11 +26,11 @@ plan 14;
}
is(bar(), 1, 'in outer scope, can call the multi that is in scope');
- nok try { eval("bar('pivo')") }, 'multi variant from inner scope not callable in outer';
+ dies_ok { eval("bar('pivo')") }, 'multi variant from inner scope not callable in outer';
}
- nok try { eval q{ bar() }}, 'no multi variants callable outside of lexical scope';
- nok try { eval q{ bar('kava')} }, 'no multi variants callable outside of lexical scope';
+ dies_ok { eval q{ bar() }}, 'no multi variants callable outside of lexical scope';
+ dies_ok { eval q{ bar('kava')} }, 'no multi variants callable outside of lexical scope';
}
# an inner multi with a signature matching an outer will hide it
@@ -54,6 +54,6 @@ multi waz() { 1 }
}
is(waz(), 1, 'multi from package still callable outside the inner scope...');
#?niecza skip 'No matching candidates to dispatch for &waz'
-nok try { eval("waz('vtak')") }, '...but lexical multi no longer callable';
+dies_ok { eval("waz('vtak')") }, '...but lexical multi no longer callable';
# vim: ft=perl6 :
View
2  S06-operator-overloading/imported-subs.t
@@ -46,7 +46,7 @@ BEGIN { @*INC.push: 't/spec/packages' };
is 4 + 2, 6, "Normal infix:<+> still works";
- nok try { eval('3 notthere 4') }, 'not-exported operator was not imported';
+ dies_ok { eval('3 notthere 4') }, 'not-exported operator was not imported';
}
eval_dies_ok '5!', 'import of operators is lexical';
View
2  S06-other/misc.t
@@ -10,4 +10,4 @@ sub a () { my $a=4; }; #zero-arg sub to test the underlying problem #OK not us
eval_dies_ok 'e("wtz")', "e should not be defined to accept arguments";
eval_dies_ok 'pi("wtz")',"pi should not be defined to accept arguments either :) ";
-nok try { eval('a(3)') }, "this should die, no arguments defined";
+dies_ok { eval('a(3)') }, "this should die, no arguments defined";
View
2  S06-signature/arity.t
@@ -125,7 +125,7 @@ is &o_two.count, 1, 'count on sub with optional and required named params';
'... also when passed to a sub first';
}
-nok try { eval("a_zero( 'hello', 'world' )") }, 'no matching sub signature';
+dies_ok { eval("a_zero( 'hello', 'world' )") }, 'no matching sub signature';
#?niecza skip 'Unable to resolve method count in class Code'
{
View
2  S06-signature/errors.t
@@ -21,7 +21,7 @@ eval_lives_ok 'sub quuuux ($!) { ... }', 'but $! is OK';
#?niecza skip 'Excess arguments to MAIN empty_sig, used 0 of 1 positionals'
{
sub empty_sig() { return };
- nok try { eval('empty_sig("RT #64344")') },
+ dies_ok { eval('empty_sig("RT #64344")') },
'argument passed to sub with empty signature';
}
View
2  S06-signature/named-parameters.t
@@ -11,7 +11,7 @@ plan 95;
return $x;
}
is a(3), 3, 'Can pass positional arguments';
- nok try { eval('a(g=>7)') }, 'Dies on passing superfluous arguments';
+ dies_ok { eval('a(g=>7)') }, 'Dies on passing superfluous arguments';
}
{
View
2  S06-signature/optional.t
@@ -91,7 +91,7 @@ eval_dies_ok 'sub opt($a = 1, $b) { }',
ok opt-type1() === Int,
'optional param with type constraints gets the right value';
sub opt-type2(Int $x = 'str') { };
- nok try { eval('opt-type2()') }, 'default values are type-checked';
+ dies_ok { eval('opt-type2()') }, 'default values are type-checked';
}
# vim: ft=perl6
View
2  S06-signature/passing-arrays.t
@@ -30,7 +30,7 @@ plan 11;
sub pa(@a) { @a.WHAT; }
my @b = 2, 3;
isa_ok pa(@b), Array, 'basic array type sanity';
- nok try { eval('pa(3)') }, 'non-slurpy array does not take a single Int';
+ dies_ok { eval('pa(3)') }, 'non-slurpy array does not take a single Int';
sub ph(%h) { 1 } #OK not used
#?niecza todo 'sigil-implied types'
View
2  S06-signature/slurpy-params.t
@@ -18,7 +18,7 @@ sub mixed($pos1, *@slurp) { "|$pos1|" ~ @slurp.join('!') }
is mixed(1), '|1|', 'Positional and slurp params';
is mixed(1, 2, 3), '|1|2!3', 'Positional and slurp params';
-nok try {eval(' mixed()')}, 'at least one arg required';
+dies_ok {eval(' mixed()')}, 'at least one arg required';
#?rakudo skip 'types on slurpy params'
{
View
4 S06-signature/unspecified.t
@@ -10,9 +10,9 @@ sub simple { 'simple' }
#?rakudo skip 'siglist'
is &simple.signature, :(), 'signature is :() when none is specified';
is simple(), 'simple', 'can call sub with no signature specified';
-nok try { eval('simple( :golf<hotel> )') },
+dies_ok { eval('simple( :golf<hotel> )') },
'sub with no signature dies when given a named argument';
-nok try { eval("simple( 'india' )") },
+dies_ok { eval("simple( 'india' )") },
'sub with no signature dies when given positional argument';
sub positional { @_[0] }
View
2  S06-traits/as.t
@@ -21,6 +21,6 @@ sub t2(Rat $x as Int) {
is($x, 2, 'object bound was coerced to the right value');
}
t2(7/3);
-nok try { eval("t2('omg hedgehog!')") }, 'Type checks still enforced';
+dies_ok { eval("t2('omg hedgehog!')") }, 'Type checks still enforced';
# vim: ft=perl6
View
2  S06-traits/is-rw.t
@@ -18,7 +18,7 @@ plan 7;
is $bar, 42, "sub changed our variable";
# RT #74830
#?niecza skip 'Binding $a is rw in MAIN foo, cannot bind read-only value to is rw parameter'
- nok try { eval('foo(28)') }, 'is rw requires a variable';
+ dies_ok { eval('foo(28)') }, 'is rw requires a variable';
}
{
View
2  S11-modules/lexical.t
@@ -10,6 +10,6 @@ plan 2;
use t::spec::packages::S11-modules::Foo;
is foo(), 'Foo::foo', 'could import foo()';
}
-nok try {eval('foo()') }, 'sub is only imported into the inner lexical scope';
+dies_ok {eval('foo()') }, 'sub is only imported into the inner lexical scope';
# vim: ft=perl6
View
2  S12-class/augment-supersede.t
@@ -20,7 +20,7 @@ use MONKEY_TYPING;
is($o.a, 'called Foo.a', 'basic method call works');
is($o.b, 'called Foo.b', 'added method call works');
- nok try { eval('augment class NonExistent { }') },
+ dies_ok { eval('augment class NonExistent { }') },
'augment on non-existent class dies';
}
View
2  S12-methods/private.t
@@ -15,7 +15,7 @@ class A {
}
is A.new().public, 12, 'Can call private method from within the class';
-nok try {eval('A.new!private')}, 'Can not call private method from outside';
+dies_ok {eval('A.new!private')}, 'Can not call private method from outside';
# indirect call syntax for public and private methods
View
2  S12-subset/subtypes.t
@@ -235,7 +235,7 @@ ok "x" !~~ NW1, 'subset declaration without where clause rejects wrong value';
{
subset Int::Positive of Int where { $_ > 0 };
sub f(Int::Positive $a) { $a * $a };
- nok try { eval('f(-2)') }, 'Cannot violate Int::Positive constraint';
+ dies_ok { eval('f(-2)') }, 'Cannot violate Int::Positive constraint';
}
# RT #71820
View
4 S32-array/pop.t
@@ -82,8 +82,8 @@ plan 33;
my @pop = 1 .. 5;
eval_dies_ok('pop', 'pop() requires arguments');
eval_dies_ok('42.pop' , '.pop should not work on scalars');
- nok try {eval('pop(@pop, 10)')}, 'pop() should not allow extra arguments';
- nok try {eval('@pop.pop(10)') }, 'pop() should not allow extra arguments';
+ dies_ok {eval('pop(@pop, 10)')}, 'pop() should not allow extra arguments';
+ dies_ok {eval('@pop.pop(10)') }, 'pop() should not allow extra arguments';
}
# Pop with Inf arrays (waiting on answers from perl6-compiler email)
View
2  integration/advent2009-day04.t
@@ -15,4 +15,4 @@ is fac(2), 2, 'fac(2) works';
is fac(3), 6, 'fac(3) works';
is fac(4), 24, 'fac(4) works';
-nok try { eval(q[ fac('oh noes i am a string')]) }, 'Can only call it with ints';
+dies_ok { eval(q[ fac('oh noes i am a string')]) }, 'Can only call it with ints';
Please sign in to comment.
Something went wrong with that request. Please try again.