Skip to content

Commit

Permalink
Add tests for RT #131561
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Jun 13, 2017
1 parent 01f8387 commit 4e394a9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion S02-types/mix.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use lib <t/spec/packages>;
use Test::Util;
use Test;

plan 213;
plan 215;

sub showkv($x) {
$x.keys.sort.map({ $^k ~ ':' ~ $x{$k} }).join(' ')
Expand Down Expand Up @@ -505,4 +505,12 @@ subtest '.hash does not cause keys to be stringified' => {
}
}

# RT #131561
{
is-deeply (a => -1, a => 1).Mix, mix(),
'final value 0 disappears in Mix for empty mix';
is-deeply (a => -1, a => 1, "b").Mix, Mix.new("b"),
'final value 0 disappears in Mix';
}

# vim: ft=perl6
10 changes: 9 additions & 1 deletion S02-types/mixhash.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use lib <t/spec/packages>;
use Test::Util;
use Test;

plan 257;
plan 259;

# L<S02/Mutable types/QuantHash of UInt>

Expand Down Expand Up @@ -594,4 +594,12 @@ subtest 'MixHash autovivification of non-existent keys' => {
}
}

# RT #131561
{
is-deeply (a => -1, a => 1).MixHash, MixHash.new,
'final value 0 disappears in MixHash (1)';
is-deeply (a => -1, a => 1, "b").MixHash, MixHash.new("b"),
'final value 0 disappears in MixHash (2)';
}

# vim: ft=perl6

0 comments on commit 4e394a9

Please sign in to comment.