Skip to content

Commit

Permalink
Add tests for #5057
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Sep 13, 2022
1 parent 2add07d commit c1ef784
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 6 deletions.
8 changes: 7 additions & 1 deletion S02-types/bag.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 249;
plan 250;

sub showkv($x) {
$x.keys.sort.map({ $^k ~ ':' ~ $x{$k} }).join(' ')
Expand Down Expand Up @@ -611,4 +611,10 @@ is <a b c>.Set.item.VAR.^name, 'Scalar', 'does .item work on Sets';

lives-ok { my %h is Bag = 42 }, "Can we initialize a Bag with a single value";

# https://github.com/rakudo/rakudo/issues/5057
{
is-deeply <a b c d e a b>.Bag>>--, <a b>.Bag,
'did on-the-fly decrement work';
}

# vim: expandtab shiftwidth=4
8 changes: 7 additions & 1 deletion S02-types/baghash.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use Test;
use lib $?FILE.IO.parent(2).add: 'packages/Test-Helpers';
use Test::Util;

plan 336;
plan 337;

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

Expand Down Expand Up @@ -805,4 +805,10 @@ is <a b c>.BagHash.item.VAR.^name, 'Scalar', 'does .item work on BagHashes';
lives-ok { my %h is BagHash = 42 },
"Can we initialize a BagHash with a single value";

# https://github.com/rakudo/rakudo/issues/5057
{
is-deeply <a b c d e a b>.BagHash>>--, <a b>.BagHash,
'did on-the-fly decrement work';
}

# vim: expandtab shiftwidth=4
8 changes: 7 additions & 1 deletion S02-types/mix.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use Test;
use lib $?FILE.IO.parent(2).add("packages/Test-Helpers");
use Test::Util;

plan 239;
plan 240;

sub showkv($x) {
$x.keys.sort.map({ $^k ~ ':' ~ $x{$k} }).join(' ')
Expand Down Expand Up @@ -573,4 +573,10 @@ is <a b c>.Mix.item.VAR.^name, 'Scalar', 'does .item work on Mixes';

lives-ok { my %h is Mix = 42 }, "Can we initialize a Mix with a single value";

# https://github.com/rakudo/rakudo/issues/5057
{
is-deeply <a b c d e a b>.Mix>>--, <a b>.Mix,
'did on-the-fly decrement work';
}

# vim: expandtab shiftwidth=4
8 changes: 7 additions & 1 deletion S02-types/mixhash.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use Test;
use lib $?FILE.IO.parent(2).add("packages/Test-Helpers");
use Test::Util;

plan 287;
plan 288;

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

Expand Down Expand Up @@ -667,4 +667,10 @@ is <a b c>.MixHash.item.VAR.^name, 'Scalar', 'does .item work on MixHashes';
lives-ok { my %h is MixHash = 42 },
"Can we initialize a MixHash with a single value";

# https://github.com/rakudo/rakudo/issues/5057
{
is-deeply <a b c d e a b>.MixHash>>--, <a b>.MixHash,
'did on-the-fly decrement work';
}

# vim: expandtab shiftwidth=4
8 changes: 7 additions & 1 deletion S02-types/set.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use Test;
use lib $?FILE.IO.parent(2).add: 'packages/Test-Helpers';
use Test::Util;

plan 243;
plan 244;

sub showset($s) { $s.keys.sort.join(' ') }

Expand Down Expand Up @@ -615,4 +615,10 @@ is <a b c>.Set.item.VAR.^name, 'Scalar', 'does .item work on Sets';

lives-ok { my %h is Set = 42 }, "Can we initialize a Set with a single value";

# https://github.com/rakudo/rakudo/issues/5057
{
is-deeply <a b c d e a b>.Set>>--, Set.new,
'did on-the-fly decrement work';
}

# vim: expandtab shiftwidth=4
8 changes: 7 additions & 1 deletion S02-types/sethash.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use Test;
use lib $?FILE.IO.parent(2).add: 'packages/Test-Helpers';
use Test::Util;

plan 276;
plan 277;

# L<S02/Mutable types/"QuantHash of Bool">

Expand Down Expand Up @@ -698,4 +698,10 @@ is <a b c>.SetHash.item.VAR.^name, 'Scalar', 'does .item work on SetHashes';
lives-ok { my %h is SetHash = 42 },
"Can we initialize a SetHash with a single value";

# https://github.com/rakudo/rakudo/issues/5057
{
is-deeply <a b c d e a b>.SetHash>>--, SetHash.new,
'did on-the-fly decrement work';
}

# vim: expandtab shiftwidth=4

0 comments on commit c1ef784

Please sign in to comment.