Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
test invert on list of pairs
  • Loading branch information
TimToady committed Feb 28, 2015
1 parent 6d85d5a commit 08174d6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion S02-types/pair.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 106;
plan 108;

# L<S02/Mutable types/A single key-to-value association>
# basic Pair
Expand Down Expand Up @@ -332,6 +332,9 @@ Note, "non-chaining binary" was later renamed to "structural infix".
is (a => [3,4]).invert».key, '3 4', 'Pair.invert splits positional values and preserves order';
isa_ok (a => [3,4]).invert[0].key, Int, 'Pair.invert.key type';
is (a => [3,4]).invert».value, 'a a', 'Pair.invert splits positional values and dups keys';

is <a b c>.pairs.invert.perl, '("a" => 0, "b" => 1, "c" => 2).list', 'list of array pairs can be inverted';
is { a => (1,2), b => <x y z> }.pairs.invert.sort.gist, '1 => a 2 => a x => b y => b z => b', 'list of hash pairs can be inverted';
}

# RT #123215
Expand Down

0 comments on commit 08174d6

Please sign in to comment.