Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete() on hashes #1222

Closed
p6rt opened this issue Aug 13, 2009 · 5 comments
Closed

delete() on hashes #1222

p6rt opened this issue Aug 13, 2009 · 5 comments
Labels
Bug LHF Low-hanging fruit, easy to resolve

Comments

@p6rt
Copy link

p6rt commented Aug 13, 2009

Migrated from rt.perl.org#68482 (status was 'resolved')

Searchable as RT68482$

@p6rt
Copy link
Author

p6rt commented Aug 13, 2009

From polettix@gmail.com

As of 0d4fe08d2e6f, rakudo has the following behaviour​:

my %h = 1 => 3; my $x = %h.delete(1); say $x.WHAT;
Array()

I expected to read "Int()" (pugs, for example, does it).

Cheers,

  Flavio.

@p6rt
Copy link
Author

p6rt commented Oct 26, 2009

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S32-hash/delete.t

commit 70175c0637b100a6ab84762fcbeef4f888c78c4f
Author​: kyle <kyle@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Mon Oct 26 03​:41​:53 2009 +0000

  [t/spec] Test for RT #​68482
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;28894 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S32-hash/delete.t b/t/spec/S32-hash/delete.t
index 04c6549..2273ec1 100644
--- a/t/spec/S32-hash/delete.t
+++ b/t/spec/S32-hash/delete.t
@@ -1,7 +1,7 @@
 use v6;
 
 use Test;
-plan 9;
+plan *;
 
 # L<S02/Names and Variables/:delete>
 
@@ -45,5 +45,18 @@ ok !defined(%hash{"a"}), "deleted hash elements are really deleted";
     eval_dies_ok '$a :delete', "Can't :delete a scalar";
 }
 
+# RT #68482
+{
+    my %rt68482 = 1 => 3;
+    #?rakudo todo 'RT 68482'
+    is %rt68482.delete(1).WHAT, 3.WHAT, '.delete.WHAT is the element';
+
+    %rt68482 = 1 => 3;
+    my $rt68482 = %rt68482.delete(1);
+    #?rakudo todo 'RT 68482'
+    is $rt68482.WHAT, 3.WHAT, '.WHAT of stored .delete is the element';
+}
+
+done_testing;
 
 # vim: ft=perl6

@p6rt
Copy link
Author

p6rt commented Oct 26, 2009

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented May 25, 2010

From @moritz

fixed in baebe1fa18aa821503c38916331c514e52e413e6 (which also added tests)

@p6rt
Copy link
Author

p6rt commented May 25, 2010

@moritz - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed May 25, 2010
@p6rt p6rt added Bug LHF Low-hanging fruit, easy to resolve labels Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug LHF Low-hanging fruit, easy to resolve
Projects
None yet
Development

No branches or pull requests

1 participant