Skip to content

Instantly share code, notes, and snippets.

@ashgti
Created January 16, 2010 21:19
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 ashgti/279013 to your computer and use it in GitHub Desktop.
Save ashgti/279013 to your computer and use it in GitHub Desktop.
use v6;
use Test;
# L<S32::Containers/"List"/"=item ">
=begin pod
built-in "list" tests
=end pod
plan 6;
my $list_sub = list(1, 2, 3);
is($list_sub.WHAT, List, '&list() creates a list assignable to a scalar.');
is($list_sub, (1, 2, 3), 'The &list() function created a list.');
is(+$list_sub, 3, 'Finding the length of the list works as expected.');
my $list_obj = List.new(4, 5, 6);
is($list_obj.WHAT, List, 'Creating a new list object with new works.');
is($list_obj, list(4, 5, 6), 'The list object contains the right values.');
is(+$list_obj, 3, 'Finding the length funcitons properly.');
# vim: ft=perl6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment