Skip to content

Instantly share code, notes, and snippets.

@zoffixznet

zoffixznet/p6.p6 Secret

Created March 13, 2018 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/0dbeeaa1a34d424f1f673d9a85b5ec90 to your computer and use it in GitHub Desktop.
Save zoffixznet/0dbeeaa1a34d424f1f673d9a85b5ec90 to your computer and use it in GitHub Desktop.
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