Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
s/dies_ok/dies-ok/g
  • Loading branch information
lizmat committed May 19, 2015
1 parent a4cac76 commit 709e414
Show file tree
Hide file tree
Showing 199 changed files with 633 additions and 633 deletions.
4 changes: 2 additions & 2 deletions S02-lexical-conventions/one-pass-parsing.t
Expand Up @@ -12,11 +12,11 @@ lives_ok { EVAL 'regex { <[ } > ]> }; 1' },
{
lives_ok { EVAL 'sub if() { "#foo" }; say if();' },
"Can call sub if()";
dies_ok { EVAL 'sub if() { "#foo" }; say if ;' },
dies-ok { EVAL 'sub if() { "#foo" }; say if ;' },
"Calling sub if without parens parsefails due to no-arg say";
lives_ok { EVAL 'sub if() { "#foo" }; say if;' },
"Calling sub if okay parens as long as not followed by whitespace";
dies_ok { EVAL 'say "OK" if+1' },
dies-ok { EVAL 'say "OK" if+1' },
"Using keyword if fails if not followed by whitespace";
}

Expand Down
2 changes: 1 addition & 1 deletion S02-literals/pairs.t
Expand Up @@ -112,7 +112,7 @@ sub f3 ($a) { WHAT($a) }
my $pair = (a => 42);

isa-ok f3($pair), Pair, 'a $pair is not treated magically...';
dies_ok { EVAL 'f3(|$pair)' }, '|$pair becomes a name, which fails to dispatch';
dies-ok { EVAL 'f3(|$pair)' }, '|$pair becomes a name, which fails to dispatch';
}

sub f4 ($a) { WHAT($a) }
Expand Down
2 changes: 1 addition & 1 deletion S02-names-vars/varnames.t
Expand Up @@ -11,7 +11,7 @@ lives_ok { EVAL 'my $!' },
lives_ok { EVAL 'my $/' },
'as can $/';

dies_ok { EVAL '$/ = "foo"' },
dies-ok { EVAL '$/ = "foo"' },
'S05: Perl 6\'s $/ variable may not be assigned to directly.';

#?niecza todo
Expand Down
2 changes: 1 addition & 1 deletion S02-names/symbolic-deref.t
Expand Up @@ -149,7 +149,7 @@ my $outer = 'outside';

# Symbolic dereferentiation syntax should work with $?SPECIAL etc. too.
# Note: I'm not 100% sure this is legal syntax. If it turns out it isn't, we'll
# have to s/ok/dies_ok/.
# have to s/ok/dies-ok/.
{
try { die 'to set $!' };
ok $::("!"), "symbolic dereferentiation works with special chars (1)";
Expand Down
6 changes: 3 additions & 3 deletions S02-types/native.t
Expand Up @@ -169,8 +169,8 @@ plan 42;
}

# RT #123789 (ensure we die, not SEGV)
dies_ok { EVAL 'my int $x = Int;' }, '"my int $x = Int" dies';
dies_ok { EVAL 'my num $x = Num;' }, '"my num $x = Num" dies';
dies_ok { EVAL 'my str $x = Str;' }, '"my str $x = Str" dies';
dies-ok { EVAL 'my int $x = Int;' }, '"my int $x = Int" dies';
dies-ok { EVAL 'my num $x = Num;' }, '"my num $x = Num" dies';
dies-ok { EVAL 'my str $x = Str;' }, '"my str $x = Str" dies';

# vim: ft=perl6
8 changes: 4 additions & 4 deletions S02-types/range.t
Expand Up @@ -90,10 +90,10 @@ is(+Range, 0, 'type numification');
{
my $r = 1..5;

dies_ok { $r.shift }, 'range is immutable (shift)';
dies_ok { $r.pop }, 'range is immutable (pop)';
dies_ok { $r.push(10) }, 'range is immutable (push)';
dies_ok { $r.unshift(10) }, 'range is immutable (unshift)';
dies-ok { $r.shift }, 'range is immutable (shift)';
dies-ok { $r.pop }, 'range is immutable (pop)';
dies-ok { $r.push(10) }, 'range is immutable (push)';
dies-ok { $r.unshift(10) }, 'range is immutable (unshift)';

my $s = 1..5;
is $r, $s, 'range has not changed';
Expand Down
26 changes: 13 additions & 13 deletions S02-types/set.t
Expand Up @@ -29,10 +29,10 @@ sub showset($s) { $s.keys.sort.join(' ') }
is showset($hash), 'a b foo', '...with the right elements';
is $hash.values.grep({ ($_ ~~ Bool) && $_ }).elems, 3, "...and values";

dies_ok { $s<a> = True }, "Can't assign to an element (Sets are immutable)";
dies_ok { $s.keys = <c d> }, "Can't assign to .keys";
dies_ok { $s.values = <True False> }, "Can't assign to .values";
dies_ok { $s<a>:delete }, "Can't :delete from Set";
dies-ok { $s<a> = True }, "Can't assign to an element (Sets are immutable)";
dies-ok { $s.keys = <c d> }, "Can't assign to .keys";
dies-ok { $s.values = <True False> }, "Can't assign to .values";
dies-ok { $s<a>:delete }, "Can't :delete from Set";

is ($s<a b>).grep(?*).elems, 2, 'Multiple-element access';
is ($s<a santa b easterbunny>).grep(?*).elems, 2, 'Multiple-element access (with nonexistent elements)';
Expand Down Expand Up @@ -76,7 +76,7 @@ sub showset($s) { $s.keys.sort.join(' ') }
my $s = set <a b foo>;
is $s<a>:exists, True, ':exists with existing element';
is $s<santa>:exists, False, ':exists with nonexistent element';
dies_ok { $s<a>:delete }, ':delete does not work on set';
dies-ok { $s<a>:delete }, ':delete does not work on set';
}

{
Expand Down Expand Up @@ -204,9 +204,9 @@ sub showset($s) { $s.keys.sort.join(' ') }
is %s<a>, True, 'Single-key subscript (existing element)';
is %s<santa>, False, 'Single-key subscript (nonexistent element)';

dies_ok { %s<a> = True }, "Can't assign to an element (Sets are immutable)";
dies_ok { %s = a => True, b => True }, "Can't assign to a %var implemented by Set";
dies_ok { %s<a>:delete }, "Can't :delete a key from a Set";
dies-ok { %s<a> = True }, "Can't assign to an element (Sets are immutable)";
dies-ok { %s = a => True, b => True }, "Can't assign to a %var implemented by Set";
dies-ok { %s<a>:delete }, "Can't :delete a key from a Set";
}

# L<S03/Hyper operators/'unordered type'>
Expand All @@ -227,7 +227,7 @@ sub showset($s) { $s.keys.sort.join(' ') }

#?niecza skip "Hypers not yet Set compatible"
#?rakudo todo "Hypers not yet Set compatible RT #124488"
dies_ok { set(1, 2) «+» set(3, 4) }, 'Set «+» Set is illegal';
dies-ok { set(1, 2) «+» set(3, 4) }, 'Set «+» Set is illegal';

# L<S32::Containers/Set/roll>

Expand Down Expand Up @@ -281,15 +281,15 @@ dies_ok { set(1, 2) «+» set(3, 4) }, 'Set «+» Set is illegal';
#?niecza skip '.grab NYI'
{
my $s = set <a b c>;
dies_ok { $s.grab }, 'cannot call .grab on a Set';
dies-ok { $s.grab }, 'cannot call .grab on a Set';
}

# L<S32::Containers/Set/grabpairs>

#?niecza skip '.grabpairs NYI'
{
my $s = set <a b c>;
dies_ok { $s.grabpairs }, 'cannot call .grabpairs on a Set';
dies-ok { $s.grabpairs }, 'cannot call .grabpairs on a Set';
}

# RT 107022
Expand Down Expand Up @@ -358,8 +358,8 @@ dies_ok { set(1, 2) «+» set(3, 4) }, 'Set «+» Set is illegal';

{
my $s = <a b c>.Set;
dies_ok { $s.pairs[0].key++ }, 'Cannot change key of Set.pairs';
dies_ok { $s.pairs[0].value = 0 }, 'Cannot change value of Set.pairs';
dies-ok { $s.pairs[0].key++ }, 'Cannot change key of Set.pairs';
dies-ok { $s.pairs[0].value = 0 }, 'Cannot change value of Set.pairs';
}

# RT #117103
Expand Down
4 changes: 2 additions & 2 deletions S02-types/sethash.t
Expand Up @@ -33,8 +33,8 @@ sub showset($s) { $s.keys.sort.join(' ') }
is showset($hash), 'a b foo', '...with the right elements';
is $hash.values.grep({ ($_ ~~ Bool) && $_ }).elems, 3, "...and values";

dies_ok { $s.keys = <c d> }, "Can't assign to .keys";
dies_ok { $s.values = <True False> }, "Can't assign to .values";
dies-ok { $s.keys = <c d> }, "Can't assign to .keys";
dies-ok { $s.values = <True False> }, "Can't assign to .values";

is ($s<a b>).grep(?*).elems, 2, 'Multiple-element access';
is ($s<a santa b easterbunny>).grep(?*).elems, 2, 'Multiple-element access (with nonexistent elements)';
Expand Down
2 changes: 1 addition & 1 deletion S02-types/sigils-and-types.t
Expand Up @@ -78,7 +78,7 @@ ok &pro.does(Callable), 'a proto does Callable';
{
sub a { return 'a' };
sub b { return 'b' };
dies_ok { &a = &b }, 'cannot just assign &b to &a';
dies-ok { &a = &b }, 'cannot just assign &b to &a';
is a(), 'a', 'and the correct function is still in place';

}
Expand Down
22 changes: 11 additions & 11 deletions S02-types/subset.t
Expand Up @@ -17,12 +17,12 @@ subset Even of Int where { $_ % 2 == 0 };
is $x, 2, 'Can assign value to a type variable with subset';
};

dies_ok { EVAL('my Even $x = 3') },
dies-ok { EVAL('my Even $x = 3') },
"Can't assign value that violates type constraint via subset";

# RT # 69518'
#?niecza todo
dies_ok { EVAL('Even.new') }, 'Cannot instantiate a subtype';
dies-ok { EVAL('Even.new') }, 'Cannot instantiate a subtype';

{
ok 2 ~~ Even, 'Can smartmatch against subsets 1';
Expand All @@ -42,11 +42,11 @@ subset Digit of Int where ^10;
is $x, 9, "other end of range";
}

dies_ok { my Digit $x = 10 },
dies-ok { my Digit $x = 10 },
'type constraints prevents assignment 1';
dies_ok { my Digit $x = -1 },
dies-ok { my Digit $x = -1 },
'type constraints prevents assignment 2';
dies_ok { my Digit $x = 3.1 },
dies-ok { my Digit $x = 3.1 },
'original type prevents assignment';

# RT #67818
Expand All @@ -58,7 +58,7 @@ dies_ok { my Digit $x = 3.1 },
subset Person of Hash where { .keys.sort ~~ <firstname lastname> }
lives_ok { my Person $p = { :firstname<Alpha>, :lastname<Bravo> } },
'can create subset of hash with where';
dies_ok { my Person $p = { :first<Charlie>, :last<Delta> } },
dies-ok { my Person $p = { :first<Charlie>, :last<Delta> } },
'subset of hash with where enforces where clause';

subset Austria of Array;
Expand All @@ -69,7 +69,7 @@ dies_ok { my Digit $x = 3.1 },
lives_ok { my NumArray $n = [] },
'can create subset of array with where';
#?rakudo skip '(noauto) succeeds for the wrong reason (need to test the error)'
dies_ok { my NumArray $n = <Echo 2> },
dies-ok { my NumArray $n = <Echo 2> },
'subset of array with where enforces where clause';

subset Meercat of Pair;
Expand All @@ -79,7 +79,7 @@ dies_ok { my Digit $x = 3.1 },
subset Ordered of Pair where { .key < .value }
lives_ok { my Ordered $o = 23 => 42 },
'can create subset of Pair with where';
dies_ok { my Ordered $o = 42 => 23 },
dies-ok { my Ordered $o = 42 => 23 },
'subset of pair with where enforces where clause';
}

Expand All @@ -88,7 +88,7 @@ dies_ok { my Digit $x = 3.1 },
my Str_not2b $text;
$text = 'amnot';
is $text, 'amnot', 'assignment to my subset of Str where pattern worked';
dies_ok { $text = 'oops' },
dies-ok { $text = 'oops' },
'my subset of Str where pattern enforces pattern';
}

Expand All @@ -97,7 +97,7 @@ dies_ok { my Digit $x = 3.1 },
my Negation $text;
$text = 'amnot';
is $text, 'amnot', 'assignment to subset of Str where pattern worked';
dies_ok { $text = 'oops' }, 'subset of Str where pattern enforces pattern';
dies-ok { $text = 'oops' }, 'subset of Str where pattern enforces pattern';
}

# RT #67256
Expand Down Expand Up @@ -174,7 +174,7 @@ my $a = 1;
}
my &bar := producer();
lives_ok { bar(2) }, 'where-constraint picks up the right lexical (+)';
dies_ok { bar(1) }, 'where-constraint picks up the right lexical (-)';
dies-ok { bar(1) }, 'where-constraint picks up the right lexical (-)';
}

{
Expand Down
28 changes: 14 additions & 14 deletions S02-types/type.t
Expand Up @@ -23,19 +23,19 @@ my Int $foo;
my Str $bar;

{
dies_ok({$foo = 'xyz'}, 'Int restricts to integers');
dies_ok { $foo = Mu }, 'Int does not accept Mu';
dies-ok({$foo = 'xyz'}, 'Int restricts to integers');
dies-ok { $foo = Mu }, 'Int does not accept Mu';
is(($foo = 42), 42, 'Int is an integer');

dies_ok({$bar = 42}, 'Str restricts to strings');
dies_ok { $bar = Mu }, 'Str does not accept Mu';
dies-ok({$bar = 42}, 'Str restricts to strings');
dies-ok { $bar = Mu }, 'Str does not accept Mu';
is(($bar = 'xyz'), 'xyz', 'Str is a strings');
}

#?niecza skip 'Trait of not available on variables'
{
my $baz of Int;
dies_ok({$baz = 'xyz'}, 'of Int restricts to integers');
dies-ok({$baz = 'xyz'}, 'of Int restricts to integers');
is(($baz = 42), 42, 'of Int is an integer');
}

Expand Down Expand Up @@ -76,7 +76,7 @@ my Str $bar;
}

# Num does not accept Int (used to, then spec changed)
dies_ok { my Num $n; $n = 42; }, 'Num does not accept Int';
dies-ok { my Num $n; $n = 42; }, 'Num does not accept Int';

# L<S02/Return types/a return type can be specified before or after the name>
{
Expand All @@ -88,18 +88,18 @@ dies_ok { my Num $n; $n = 42; }, 'Num does not accept Int';

is(returntype1(Bool::True), 'ok', 'good return value works (returns)');
#?niecza todo 'retrun value type checking NYI'
dies_ok({ returntype1(Bool::False) }, 'bad return value dies (returns)');
dies-ok({ returntype1(Bool::False) }, 'bad return value dies (returns)');
is(returntype2(Bool::True), 42, 'good return value works (of)');
#?niecza todo 'retrun value type checking NYI'
dies_ok({ returntype2(Bool::False) }, 'bad return value dies (of)');
dies-ok({ returntype2(Bool::False) }, 'bad return value dies (of)');

is(returntype3(Bool::True), True, 'good return value works (my Type sub)');
#?niecza todo 'retrun value type checking NYI'
dies_ok({ returntype3(Bool::False) }, 'bad return value dies (my Type sub)');
dies-ok({ returntype3(Bool::False) }, 'bad return value dies (my Type sub)');

is(returntype4(Bool::True), 'ok', 'good return value works (-->)');
#?niecza todo 'retrun value type checking NYI'
dies_ok({ returntype4(Bool::False) }, 'bad return value dies (-->)');
dies-ok({ returntype4(Bool::False) }, 'bad return value dies (-->)');
}

{
Expand All @@ -111,18 +111,18 @@ dies_ok { my Num $n; $n = 42; }, 'Num does not accept Int';

is(returntype1(Bool::True), 'ok', 'good implicit return value works (returns)');
#?niecza todo 'retrun value type checking NYI'
dies_ok({ returntype1(Bool::False) }, 'bad implicit return value dies (returns)');
dies-ok({ returntype1(Bool::False) }, 'bad implicit return value dies (returns)');
is(returntype2(Bool::True), 42, 'good implicit return value works (of)');
#?niecza todo 'retrun value type checking NYI'
dies_ok({ returntype2(Bool::False) }, 'bad implicit return value dies (of)');
dies-ok({ returntype2(Bool::False) }, 'bad implicit return value dies (of)');

is(returntype3(Bool::True), True, 'good implicit return value works (my Type sub)');
#?niecza todo 'retrun value type checking NYI'
dies_ok({ returntype3(Bool::False) }, 'bad implicit return value dies (my Type sub)');
dies-ok({ returntype3(Bool::False) }, 'bad implicit return value dies (my Type sub)');

is(returntype4(Bool::True), 'ok', 'good implicit return value works (-->)');
#?niecza todo 'retrun value type checking NYI'
dies_ok({ returntype4(Bool::False) }, 'bad implicit return value dies (-->)');
dies-ok({ returntype4(Bool::False) }, 'bad implicit return value dies (-->)');
}

{
Expand Down
4 changes: 2 additions & 2 deletions S02-types/whatever.t
Expand Up @@ -237,9 +237,9 @@ eval-dies-ok '{*.{}}()', '{*.{}}() dies';
is $f(7), 2, 'Whatever-currying with R- (2)';
is $f(0), -5, 'Whatever-currying with R- (3)';

dies_ok { &infix:<+>(*, 42) }, '&infix:<+>(*, 42) doesn\'t make a closure';
dies-ok { &infix:<+>(*, 42) }, '&infix:<+>(*, 42) doesn\'t make a closure';
#?niecza skip 'Undeclared routine'
dies_ok { &infix:<R+>(*, 42) }, '&infix:<+>(*, 42) doesn\'t make a closure';
dies-ok { &infix:<R+>(*, 42) }, '&infix:<+>(*, 42) doesn\'t make a closure';
}

# RT 79166
Expand Down
6 changes: 3 additions & 3 deletions S03-binding/ro.t
Expand Up @@ -11,15 +11,15 @@ plan 11;
$x ::= $y;
is $x, 3, '::= on scalars took the value from the RHS';
#?rakudo todo 'nom regression'
dies_ok { $x = 5 }; '... and made the LHS RO';
dies-ok { $x = 5 }; '... and made the LHS RO';
#?rakudo todo 'nom regression'
is $x, 3, 'variable is still 3';
}

{
my Int $a = 4;
my Str $b;
dies_ok { $b ::= $a },
dies-ok { $b ::= $a },
'Cannot ro-bind variables with incompatible type constraints';
}

Expand All @@ -31,7 +31,7 @@ plan 11;
is @x.join('|'), 'd|e', '::= on arrays';
#?rakudo 4 todo '::= on arrays'
#?niecza todo
dies_ok { @x := <3 4 foo> }, '... make RO';
dies-ok { @x := <3 4 foo> }, '... make RO';
#?niecza todo
is @x.join('|'), 'd|e', 'value unchanged';
#?niecza todo
Expand Down
2 changes: 1 addition & 1 deletion S03-binding/scalars.t
Expand Up @@ -101,7 +101,7 @@ eval-dies-ok '0 := 1', 'cannot bind to a literal';
#?niecza todo "difference of interpretation on ro binding"
is $a, 42, "bound readonly sub param was bound correctly (2) (no change)";

dies_ok { $a = 23 },
dies-ok { $a = 23 },
"bound readonly sub param remains readonly (1)";
#?niecza todo "difference of interpretation on ro binding"
is $a, 42,
Expand Down

0 comments on commit 709e414

Please sign in to comment.