Skip to content

Instantly share code, notes, and snippets.

@tadzik
Created August 1, 2011 20:49
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 tadzik/1118969 to your computer and use it in GitHub Desktop.
Save tadzik/1118969 to your computer and use it in GitHub Desktop.
┌─[tadzik@yavin4]─[~/src/nom] (nom)
└─[%]─> cat fail.pl
use Test;
my @unshift = ();
unshift @unshift, (1, 2, 3);
say @unshift.perl;
say @unshift.WHAT;
say +@unshift;
is(+@unshift, 3, 'we have 3 elements in the array');
is(@unshift[0], 1, 'got the expected element');
is(@unshift[1], 2, 'got the expected element');
is(@unshift[2], 3, 'got the expected element');
┌─[tadzik@yavin4]─[~/src/nom] (nom)
└─[%]─> ./perl6 fail.pl
Array.new(1, 2, 3)
Array()
1
not ok 1 - we have 3 elements in the array
# got: '1'
# expected: '3'
not ok 2 - got the expected element
# got: '1 2 3'
# expected: '1'
Use of uninitialized value in string context
not ok 3 - got the expected element
Use of uninitialized value in string context
# got: ''
# expected: '2'
Use of uninitialized value in string context
not ok 4 - got the expected element
Use of uninitialized value in string context
# got: ''
# expected: '3'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment