Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

more flattening tests

git-svn-id: http://svn.pugscode.org/pugs@2960 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit 9ff7d304cb3cb66fe55b442a15fa4ad81788767c 1 parent 22ccc98
juerd authored
Showing with 28 additions and 2 deletions.
  1. +6 −1 READTHEM
  2. +22 −1 t/pugsbugs/flattening.t
View
7 READTHEM
@@ -26,6 +26,12 @@ Yet Another Haskell Tutorial - Hal Daume II
Haskell Mini-Primer (this covers infix $ and . operators)
<http://conal.net/pan/haskell-primer.htm>
+= Perl 6 books (always outdated :))
+
+Perl 6 and Parrot Essenti - Allison Randal, Dan Sugalski, Leopold Tőtsch
+Perl 6 Now: The core ideas illustrated with Perl 5 - Scott Walters
+Perl 6 Bible (Perl6::Bible) - VA
+
= Non-Haskell books
Types and Programming Languages - Benjamin C. Pierce
@@ -37,4 +43,3 @@ Higher Order Perl - Mark Jason Dominus
The Silmarillion - J.R.R. Tolkien
The Demolished Man - Alfred Bester
Flow My Tears the Policeman Said - Phillip K. Dick
-
View
23 t/pugsbugs/flattening.t
@@ -3,7 +3,7 @@
use v6;
use Test;
-plan 27;
+plan 34;
{
my @array = 11 .. 15;
@@ -56,3 +56,24 @@ plan 27;
is(%hash<12>, undef, 'nothing at key "12"');
is(%hash<22>, undef, 'nothing at key "22"');
}
+
+{
+ my @a;
+ push @a, 1;
+ is(@a.elems, 1, 'Simple push works');
+ push @a, [];
+ is(@a.elems, 2, 'Arrayref literal not flattened');
+ push @a, {};
+ is(@a.elems, 3, 'Hashref literal not flattened');
+ my @foo;
+ push @a, \@foo;
+ is(@a.elems, 4, 'Arrayref not flattened');
+ my %foo;
+ push @a, \%foo;
+ is(@a.elems, 5, 'Hashref not flattened');
+ push @a, @foo;
+ is(@a.elems, 5, 'Array flattened');
+ push @a, %foo;
+ is(@a.elems, 5, 'Hash flattened');
+}
+
Please sign in to comment.
Something went wrong with that request. Please try again.