Skip to content

Commit

Permalink
[v6.d REVIEW] Appendicise Pair.new tests
Browse files Browse the repository at this point in the history
Orig: a523aef60
  • Loading branch information
zoffixznet committed Sep 16, 2018
1 parent 445c3c5 commit 539f9bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
9 changes: 8 additions & 1 deletion APPENDICES/A02-some-day-maybe/multi-no-match.t
Expand Up @@ -7,7 +7,7 @@ use Test;
# Since there's yet no existing behaviour for some of such combinations,
# X::Multi::NoMatch is thrown. This APPENDIX test file is for such tests.

plan 10;
plan 12;

{ # RT #129773
throws-like { [].splice: 0, [] }, X::Multi::NoMatch,
Expand Down Expand Up @@ -39,3 +39,10 @@ dies-ok { 42.lines: |<bunch of incorrect args> },

throws-like { "".match: Nil }, X::Multi::NoMatch,
'.match with Nil matcher does not hang';

{ # RT#131339
throws-like { Pair.new: <foo bar ber meow>, <meows>, 42 }, X::Multi::NoMatch,
'Pair.new with wrong positional args does not go to Mu.new';
throws-like { Pair.new: :42a }, X::Multi::NoMatch,
'Pair.new with wrong named args does not go to Mu.new';
}
10 changes: 1 addition & 9 deletions S02-types/pair.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 4 * 19 + 109;
plan 4 * 19 + 107;

# L<S02/Mutable types/A single key-to-value association>
# basic Pair
Expand Down Expand Up @@ -406,14 +406,6 @@ subtest 'Pair.ACCEPTS' => {
is-deeply :bar .ACCEPTS(Foo), False, 'custom class (False)';
}

{ # RT#131339
throws-like { Pair.new: <foo bar ber meow>, <meows>, 42 }, X::Multi::NoMatch,
'Pair.new with wrong positional args does not go to Mu.new';
throws-like { Pair.new: :42a }, X::Multi::NoMatch,
'Pair.new with wrong named args does not go to Mu.new';
}


subtest 'Pair.invert' => {
my @tests = [ a => 42, (42 => 'a',).Seq ], [ 42 => 70, (70 => 42, ).Seq ],
[ foo => (bar => meow => 42), ((bar => meow => 42) => 'foo',).Seq ],
Expand Down

0 comments on commit 539f9bd

Please sign in to comment.