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

.hash on [Bag|Mix][Hash]? types stringifies keys #5513

Closed
p6rt opened this issue Aug 2, 2016 · 4 comments
Closed

.hash on [Bag|Mix][Hash]? types stringifies keys #5513

p6rt opened this issue Aug 2, 2016 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 2, 2016

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

Searchable as RT128806$

@p6rt
Copy link
Author

p6rt commented Aug 2, 2016

From @zoffixznet

As reported in RT#​127402, Set.hash stringified keys. That problem has since been fixed, however,
it still exists on Bag, BagHash, Mix, and MixHash types​:

zoffix@​VirtualBox​:~/CPANPRC/rakudo$ cat ../test.p6
use Test;
plan 15;

is Set.new($(<a b>)).hash.keys[0][0], 'a', 'Set.new';
is ($(<a b>),).Set.hash.keys[0][0], 'a', '.Set';
is set($(<a b>),).hash.keys[0][0], 'a', 'set()';

is SetHash.new($(<a b>)).hash.keys[0][0], 'a', 'SetHash.new';
is ($(<a b>),).SetHash.hash.keys[0][0], 'a', '.SetHash';

is Bag.new($(<a b>)).hash.keys[0][0], 'a', 'Bag.new';
is ($(<a b>),).Bag.hash.keys[0][0], 'a', '.Bag';
is bag($(<a b>)).hash.keys[0][0], 'a', 'bag()';

is BagHash.new($(<a b>)).hash.keys[0][0], 'a', 'BagHash.new';
is ($(<a b>),).BagHash.hash.keys[0][0], 'a', '.BagHash';

is Mix.new($(<a b>)).hash.keys[0][0], 'a', 'Mix.new';
is ($(<a b>),).Mix.hash.keys[0][0], 'a', '.Mix';
is mix($(<a b>)).hash.keys[0][0], 'a', 'mix()';

is MixHash.new($(<a b>)).hash.keys[0][0], 'a', 'MixHash.new';
is ($(<a b>),).MixHash.hash.keys[0][0], 'a', '.MixHash';

zoffix@​VirtualBox​:~/CPANPRC/rakudo$ prove -e './perl6-m' -vlr ../test.p6
../test.p6 ..
1..15
ok 1 - Set.new
ok 2 - .Set
ok 3 - set()
ok 4 - SetHash.new
ok 5 - .SetHash
not ok 6 - Bag.new
# Failed test 'Bag.new'
# at ../test.p6 line 11
# expected​: 'a'
# got​: 'a b'
not ok 7 - .Bag

# Failed test '.Bag'
# at ../test.p6 line 12
# expected​: 'a'
# got​: 'a b'
not ok 8 - bag()

# Failed test 'bag()'
# at ../test.p6 line 13
# expected​: 'a'
# got​: 'a b'
not ok 9 - BagHash.new

# Failed test 'BagHash.new'
# at ../test.p6 line 15
# expected​: 'a'not ok 10 - .BagHash

# got​: 'a b'

# Failed test '.BagHash'
# at ../test.p6 line 16
# expected​: 'a'
# got​: 'a b'
not ok 11 - Mix.new

# Failed test 'Mix.new'
# at ../test.p6 line 18
# expected​: 'a'
# got​: 'a b'
not ok 12 - .Mix

# Failed test '.Mix'
# at ../test.p6 line 19
# expected​: 'a'
# got​: 'a b'
not ok 13 - mix()

# Failed test 'mix()'
# at ../test.p6 line 20
# expected​: 'a'
# got​: 'a b'
not ok 14 - MixHash.new

# Failed test 'MixHash.new'
# at ../test.p6 line 22
# expected​: 'a'
not ok 15 - .MixHash
# got​: 'a b'

# Failed test '.MixHash'
# at ../test.p6 line 23
# expected​: 'a'
# got​: 'a b'
# Looks like you failed 10 tests of 15
Dubious, test returned 10 (wstat 2560, 0xa00)
Failed 10/15 subtests

Test Summary Report


../test.p6 (Wstat​: 2560 Tests​: 15 Failed​: 10)
  Failed tests​: 6-15
  Non-zero exit status​: 10
Files=1, Tests=15, 0 wallclock secs ( 0.03 usr 0.00 sys + 0.37 cusr 0.03 csys = 0.43 CPU)
Result​: FAIL
zoffix@​VirtualBox​:~/CPANPRC/rakudo$

--
Cheers,
ZZ | https://twitter.com/zoffix

@p6rt
Copy link
Author

p6rt commented Aug 2, 2016

From @zoffixznet

♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁

TODO-fudged tests added in Raku/roast@f434b8168a

🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥

--
Cheers,
ZZ | https://twitter.com/zoffix

@p6rt
Copy link
Author

p6rt commented Aug 2, 2016

From @zoffixznet

Never mind. Found a simple fix.

Fixed in rakudo/rakudo@f1313dbc93
Tests unfudged.

--
Cheers,
ZZ | https://twitter.com/zoffix

@p6rt
Copy link
Author

p6rt commented Aug 2, 2016

@zoffixznet - Status changed from 'new' to 'resolved'

@p6rt p6rt closed this as completed Aug 2, 2016
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant