Instantly share code, notes, and snippets.

@zoffixznet /p6.p6 Secret
Created Mar 13, 2018

Embed
What would you like to do?
subtest 'list, hash, pair, produce right things with itemized args' => {
my $list = 1, 2, 3;
my $arr = [1, 2, 3];
my $hash = {:42foo, :70bar};
my $map = Map.new: (:42foo, :70bar);
my $pair = :42foo;
is-deeply @$list, $list, '@$list';
is-deeply @$arr, $arr, '@$arr';
is-deeply (@$hash).sort, $hash.list.sort, '@$hash';
is-deeply (@$map ).sort, $map .list.sort, '@$map';
is-deeply @$pair, $pair.list, '@$pair';
is-deeply list($list), $list, 'list($list)';
is-deeply list($arr), $arr, 'list($arr)';
is-deeply list($hash).sort, $hash.list.sort, 'list($hash)';
is-deeply list($map ).sort, $map .list.sort, 'list($map)';
is-deeply list($pair), $pair.list, 'list($pair)';
is-deeply %$list, $list.hash, '%$list';
is-deeply %$arr, $arr .hash, '%$arr';
is-deeply %$hash, $hash, '%$hash';
is-deeply %$map, $map, '%$map';
is-deeply %$pair, $pair.hash, '%$pair';
is-deeply hash($list), $list.hash, 'hash($list)';
is-deeply hash($arr), $arr .hash, 'hash($arr)';
is-deeply hash($hash), $hash, 'hash($hash)';
is-deeply hash($map), $map, 'hash($map)';
is-deeply hash($pair), $pair.hash, 'hash($pair)';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment