Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding some tests for List.new, Array.new, &list() and adding a descr…

…iption to S32-List and S32-Array

git-svn-id: http://svn.pugscode.org/pugs@29558 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit 5309f04a2894c4819ae61dc53c105c63483f03d2 1 parent a55efad
ash authored
Showing with 45 additions and 0 deletions.
  1. +20 −0 S32-array/create.t
  2. +25 −0 S32-list/create.t
View
20 S32-array/create.t
@@ -0,0 +1,20 @@
+use v6;
+use Test;
+
+# L<S32::Containers/"Array"/"=item ">
+
+=begin pod
+
+built-in "Array" tests
+
+=end pod
+
+plan 3;
+
+my $array_obj = Array.new(4, 5, 6);
+is($array_obj.WHAT, Array, 'Creating a new list object with new works.');
+is($array_obj, list(4, 5, 6), 'The list object contains the right values.');
+is(+$array_obj, 3, 'Finding the length funcitons properly.');
+
+# vim: ft=perl6
+
View
25 S32-list/create.t
@@ -0,0 +1,25 @@
+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
+
Please sign in to comment.
Something went wrong with that request. Please try again.