Skip to content

Instantly share code, notes, and snippets.

@Tux
Created March 2, 2015 14:44
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 Tux/983cdf2c40c674277d0e to your computer and use it in GitHub Desktop.
Save Tux/983cdf2c40c674277d0e to your computer and use it in GitHub Desktop.
use v6;
use Test;
my @foo = ^10;
sub do_test (@expect) {
is_deeply([1,2], @expect, "direct");
}
sub do_test2 (@expect) {
my @exp = @expect;
is_deeply([1,2], @exp, "copy");
}
do_test(@foo[1,2]);
do_test([1,2]);
do_test2(@foo[1,2]);
do_test2([1,2]);
done;
=>
not ok 1 - direct
# Failed test 'direct'
# at t.pl line 7
# expected: $(1, 2)
# got: [1, 2]
ok 2 - direct
ok 3 - copy
ok 4 - copy
1..4
# Looks like you failed 1 tests of 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment