Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
test for %hash.kv
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Garrett Rooney  
View profile  
 More options Mar 4 2005, 9:37 pm
Newsgroups: perl.perl6.compiler
From: roo...@electricjellyfish.net (Garrett Rooney)
Date: Fri, 04 Mar 2005 21:37:34 -0500
Local: Fri, Mar 4 2005 9:37 pm
Subject: [pugs] test for %hash.kv

Since the first thing I actually tried to do with Pugs was to use the
%hash.kv method (see S04.pod) to iterate over the keys and values in a
hash, and it of course didn't work since it hasn't been implemented yet,
I figured I should at least send in a test for it.

Here's a diff to t/op/hash.t adding a simple test.

-garrett

[ kv-test.diff < 1K ]
Index: t/op/hash.t
===================================================================
--- t/op/hash.t (revision 565)
+++ t/op/hash.t (working copy)
@@ -9,7 +9,7 @@

 =cut

-plan 40;
+plan 42;

 # basic lvalue assignment

@@ -110,3 +110,11 @@
 todo_is %hash8{'key'}, 'value', 'colonpair :key<value>';
 todo_is %hash8{'three'}, 3, 'colonpair :three(3)';

+# kv method
+
+my $key;
+my $val;
+eval 'my %hash9 = (1, 2); for %hash9.kv -> $k,$v { $key = $k; $val = $v; }';
+todo_is($key, 1, "\%hash.kv gave us our key");
+todo_is($val, 2, "\%hash.kv gave us our val");
+


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Luke Palmer  
View profile  
 More options Mar 4 2005, 9:41 pm
Newsgroups: perl.perl6.compiler
From: l...@luqui.org (Luke Palmer)
Date: Fri, 4 Mar 2005 19:41:14 -0700
Local: Fri, Mar 4 2005 9:41 pm
Subject: Re: [pugs] test for %hash.kv

Garrett Rooney writes:
> Since the first thing I actually tried to do with Pugs was to use the
> %hash.kv method (see S04.pod) to iterate over the keys and values in a
> hash, and it of course didn't work since it hasn't been implemented yet,
> I figured I should at least send in a test for it.

> Here's a diff to t/op/hash.t adding a simple test.

Thanks, applied.

Luke


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google