patch for t/operators/hyper.t

0 views
Skip to first unread message

David Christensen

unread,
Apr 17, 2005, 11:11:47 AM4/17/05
to perl6-c...@perl.org
Enclosed is a patch for t/operators/hyper.t to test for some corner
cases with list extension. Let me know if the unicode ">>" are coming
through correctly; I am not seeing them as such in my email.

Thanks,

David Christensen
-------

Index: hyper.t
===================================================================
--- hyper.t (revision 2039)
+++ hyper.t (working copy)
@@ -9,7 +9,7 @@

=cut

-plan 22;
+plan 30;

{ # binary infix
my @r;
@@ -85,7 +85,7 @@
todo_is(~@r, ~@e, "hyper op on assignment/pipeline ASCII notation");
};

-{ # dimention upgrade
+{ # dimension upgrade
my @r;
eval '@r = (1, 2, 3) »+« 1';
my @e = (2, 3, 4);
@@ -102,6 +102,39 @@
@r = 2 >>*<< (10, 20, 30);
@e = (20, 40, 60);
is(~@r, ~@e, "auto dimension upgrade on lhs ASCII notation");
+
+ @r = (1,2,3,4) »+« (1,2);
+ @e = (2,4,3,4);
+ is(~@r, ~@e, "list-level element extension on rhs");
+
+ @r = (1,2,3,4) >>+<< (1,2);
+ @e = (2,4,3,4);
+ is(~@r, ~@e, "list-level element extension on rhs ASCII notation");
+
+ @r = (1,2) »+« (1,2,3,4);
+ @e = (2,4,3,4);
+ is(~@r, ~@e, "list-level element extension on lhs");
+
+ @r = (1,2) >>+<< (1,2,3,4);
+ @e = (2,4,3,4);
+ is(~@r, ~@e, "list-level element extension on lhs ASCII notation");
+
+ @r = (1,2,3,4) »+« (1,);
+ @e = (2,2,3,4);
+ is(~@r, ~@e, "list-level element extension on rhs");
+
+ @r = (1,2,3,4) >>+<< (1,);
+ @e = (2,2,3,4);
+ is(~@r, ~@e, "list-level element extension on rhs ASCII notation");
+
+ @r = (1,) »+« (1,2,3,4);
+ @e = (2,2,3,4);
+ is(~@r, ~@e, "list-level element extension on lhs");
+
+ @r = (1,) >>+<< (1,2,3,4);
+ @e = (2,2,3,4);
+ is(~@r, ~@e, "list-level element extension on lhs ASCII notation");
+
};

{ # unary postfix again, but with a twist
@@ -114,4 +147,3 @@
@e = (1, 2, 3);
todo_is(~@r, ~@e);
};
-

Autrijus Tang

unread,
Apr 17, 2005, 12:13:27 PM4/17/05
to David Christensen, perl6-c...@perl.org
On Sun, Apr 17, 2005 at 10:11:47AM -0500, David Christensen wrote:
> Enclosed is a patch for t/operators/hyper.t to test for some corner
> cases with list extension.

Nice, applied.

> Let me know if the unicode ">>" are coming
> through correctly; I am not seeing them as such in my email.

Indeed it looks broken to me. So much for iso-8859-1 compatibility...

Would you like a committer bit? :-)

Thanks,
/Autrijus/

Nicholas Clark

unread,
Apr 18, 2005, 10:08:00 AM4/18/05
to David Christensen, perl6-c...@perl.org
On Sun, Apr 17, 2005 at 10:11:47AM -0500, David Christensen wrote:
> Enclosed is a patch for t/operators/hyper.t to test for some corner
> cases with list extension. Let me know if the unicode ">>" are coming
> through correctly; I am not seeing them as such in my email.

Your mailer claims that your message is ISO-8859-1

> +
> + @r = (1,2,3,4) »+« (1,2);

./perl -Ilib -MEncode -wle '$m = "»+«";print$u = Encoddee::::e"macroman", $m); print Encode::decode ("utf8", $u)'
»+«
»+«

What you're actually sending in the body is the utf8 bytes converted in a
ISO-8859-1 => MacRoman translation. (I think)

Did you cut and paste from (say) TextEdit into Mail?

IIRC both TextEdit and carbonised Emacs have an annoying habit of assuming
that by default files are in MacRoman.

Nicholas Clark

Reply all
Reply to author
Forward
0 new messages