Skip Menu |
Report information
Id: 130366
Status: resolved
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: elizabeth <liz [at] dijkmat.nl>
Cc:
AdminCc:

Severity: (no value)
Tag: testneeded
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: BagHash/MixHash values don't check for zeroness
Date: Sat, 17 Dec 2016 10:41:45 +0100
To: rakudobug [...] perl.org
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
Download (untitled) / with headers
text/plain 667b
$ 6 'my $b = <a b b c d e f>.BagHash; $_-- for $b.values; dd $b' BagHash $b = ("a"=>0,"c"=>0,"b"=>1,"e"=>0,"f"=>0,"d"=>0).BagHash *SHOULD* be BagHash $b = ("b"=>1).BagHash $ 6 'my $b = <a b b c d e f>.BagHash; .value-- for $b.pairs; dd $b' BagHash $b = ("a"=>0,"c"=>0,"b"=>1,"e"=>0,"f"=>0,"d"=>0).BagHash *SHOULD* be BagHash $b = ("b"=>1).BagHash $ 6 'my $b = <a b b c d e f>.BagHash; $_ = 0 for $b.values; dd $b' BagHash $b = ("a"=>0,"c"=>0,"b"=>0,"e"=>0,"f"=>0,"d"=>0).BagHash *SHOULD* be BagHash $b = ("b"=>1).BagHash Same for MixHash. Baggy/Mixy need to have the equivalent logic to ISINSET from SetHash. RTing this so it won’t fall through the cracks.
This was resolved together with https://rt.perl.org/Ticket/Display.html?id=131241

Tests needed, maybe. See other ticket for info on this.
On 2016-12-17 01:42:04, elizabeth wrote:
Show quoted text
> $ 6 'my $b = <a b b c d e f>.BagHash; $_-- for $b.values; dd $b'
> BagHash $b = ("a"=>0,"c"=>0,"b"=>1,"e"=>0,"f"=>0,"d"=>0).BagHash
> *SHOULD* be BagHash $b = ("b"=>1).BagHash
>
>
> $ 6 'my $b = <a b b c d e f>.BagHash; .value-- for $b.pairs; dd $b'
> BagHash $b = ("a"=>0,"c"=>0,"b"=>1,"e"=>0,"f"=>0,"d"=>0).BagHash
> *SHOULD* be BagHash $b = ("b"=>1).BagHash
>
>
> $ 6 'my $b = <a b b c d e f>.BagHash; $_ = 0 for $b.values; dd $b'
> BagHash $b = ("a"=>0,"c"=>0,"b"=>0,"e"=>0,"f"=>0,"d"=>0).BagHash
> *SHOULD* be BagHash $b = ("b"=>1).BagHash
>
>
> Same for MixHash. Baggy/Mixy need to have the equivalent logic to
> ISINSET from SetHash.
>
>
> RTing this so it won’t fall through the cracks.


On Tue, 04 Jul 2017 14:53:26 -0700, alex.jakimenko@gmail.com wrote: Show quoted text
> This was resolved together with > https://rt.perl.org/Ticket/Display.html?id=131241 > > Tests needed, maybe. See other ticket for info on this. > On 2016-12-17 01:42:04, elizabeth wrote:
> > $ 6 'my $b = <a b b c d e f>.BagHash; $_-- for $b.values; dd $b' > > BagHash $b = ("a"=>0,"c"=>0,"b"=>1,"e"=>0,"f"=>0,"d"=>0).BagHash > > *SHOULD* be BagHash $b = ("b"=>1).BagHash > > > > > > $ 6 'my $b = <a b b c d e f>.BagHash; .value-- for $b.pairs; dd $b' > > BagHash $b = ("a"=>0,"c"=>0,"b"=>1,"e"=>0,"f"=>0,"d"=>0).BagHash > > *SHOULD* be BagHash $b = ("b"=>1).BagHash > > > > > > $ 6 'my $b = <a b b c d e f>.BagHash; $_ = 0 for $b.values; dd $b' > > BagHash $b = ("a"=>0,"c"=>0,"b"=>0,"e"=>0,"f"=>0,"d"=>0).BagHash > > *SHOULD* be BagHash $b = ("b"=>1).BagHash > > > > > > Same for MixHash. Baggy/Mixy need to have the equivalent logic to > > ISINSET from SetHash. > > > > > > RTing this so it won’t fall through the cracks.
Tests added in https://github.com/perl6/roast/commit/75ee890be2f778b7bec19477f83bdcd0ef0893a8. Closing issue.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org