Browse files

[t/spec] Tests for mixed hash / scalar hypers.

git-svn-id: http://svn.pugscode.org/pugs@31034 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent 9ba1733 commit e57d81e9310a6b9baa9ec8537c580e7c76c57449 colomon committed Jun 1, 2010
Showing with 27 additions and 0 deletions.
  1. +27 −0 S03-metaops/hyper.t
View
27 S03-metaops/hyper.t
@@ -454,6 +454,33 @@ my @e;
is %r<c>, 6, 'hash - correct result from >>!';
}
+{
+ my %a = a => 1, b => 2, c => 3;
+
+ my %r = %a >>*>> 4;
+ is +%r, 3, 'hash - >>*>> result has right number of keys';
+ is %r<a>, 4, 'hash - correct result from >>*>>';
+ is %r<b>, 8, 'hash - correct result from >>*>>';
+ is %r<c>, 12, 'hash - correct result from >>*>>';
+
+ %r = 2 <<**<< %a ;
+ is +%r, 3, 'hash - <<**<< result has right number of keys';
+ is %r<a>, 2, 'hash - correct result from <<**<<';
+ is %r<b>, 4, 'hash - correct result from <<**<<';
+ is %r<c>, 8, 'hash - correct result from <<**<<';
+
+ %r = %a <<*>> 4;
+ is +%r, 3, 'hash - <<*>> result has right number of keys';
+ is %r<a>, 4, 'hash - correct result from <<*>>';
+ is %r<b>, 8, 'hash - correct result from <<*>>';
+ is %r<c>, 12, 'hash - correct result from <<*>>';
+
+ %r = 2 <<**>> %a ;
+ is +%r, 3, 'hash - <<**>> result has right number of keys';
+ is %r<a>, 2, 'hash - correct result from <<**>>';
+ is %r<b>, 4, 'hash - correct result from <<**>>';
+ is %r<c>, 8, 'hash - correct result from <<**>>';
+}
# test non-UTF-8 input
#?pugs skip 'eval(Buf)'

0 comments on commit e57d81e

Please sign in to comment.