Skip to content

Commit c399710

Browse files
committed
Translate the last batch of .Bag tests to .KeyBag tests.
1 parent 14f35c6 commit c399710

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

S02-types/bag.t

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,10 @@ sub showkv($x) {
271271
ok @a.grep(* eq 'b') < 2, '.pick(100) (2)';
272272
}
273273

274-
#?rakudo skip ".Set NYI"
274+
#?rakudo skip ".Bag NYI"
275275
{
276-
isa_ok 42.Bag, Bag, "Method .bag works on Int-1";
277-
is showkv(42.Bag), "42:1", "Method .bag works on Int-2";
276+
isa_ok 42.Bag, Bag, "Method .Bag works on Int-1";
277+
is showkv(42.Bag), "42:1", "Method .Bag works on Int-2";
278278
isa_ok "blue".Bag, Bag, "Method .Bag works on Str-1";
279279
is showkv("blue".Bag), "blue:1", "Method .Bag works on Str-2";
280280
my @a = <Now the cross-handed set was the Paradise way>;
@@ -284,7 +284,8 @@ sub showkv($x) {
284284
isa_ok %x.Bag, Bag, "Method .Bag works on Hash-1";
285285
is showkv(%x.Bag), "a:1 b:2", "Method .Bag works on Hash-2";
286286
isa_ok (@a, %x).Bag, Bag, "Method .Bag works on Parcel-1";
287-
is showkv((@a, %x).Bag), "Now:1 Paradise:1 a:1 b:2 cross-handed:1 set:1 the:2 was:1 way:1", "Method .bag works on Parcel-2";
287+
is showkv((@a, %x).Bag), "Now:1 Paradise:1 a:1 b:2 cross-handed:1 set:1 the:2 was:1 way:1",
288+
"Method .Bag works on Parcel-2";
288289
}
289290

290291
# vim: ft=perl6

S02-types/keybag.t

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use v6;
22
use Test;
33

4-
plan 153;
4+
plan 163;
55

66
# L<S02/Mutable types/KeyHash of UInt>
77

@@ -350,4 +350,21 @@ sub showkv($x) {
350350
'a:1 b:2 c:2 d:1', '... works as expected';
351351
}
352352

353+
#?rakudo skip ".KeyBag NYI"
354+
{
355+
isa_ok 42.KeyBag, KeyBag, "Method .KeyBag works on Int-1";
356+
is showkv(42.KeyBag), "42:1", "Method .KeyBag works on Int-2";
357+
isa_ok "blue".KeyBag, KeyBag, "Method .KeyBag works on Str-1";
358+
is showkv("blue".KeyBag), "blue:1", "Method .KeyBag works on Str-2";
359+
my @a = <Now the cross-handed set was the Paradise way>;
360+
isa_ok @a.KeyBag, KeyBag, "Method .KeyBag works on Array-1";
361+
is showkv(@a.KeyBag), "Now:1 Paradise:1 cross-handed:1 set:1 the:2 was:1 way:1", "Method .KeyBag works on Array-2";
362+
my %x = "a" => 1, "b" => 2;
363+
isa_ok %x.KeyBag, KeyBag, "Method .KeyBag works on Hash-1";
364+
is showkv(%x.KeyBag), "a:1 b:2", "Method .KeyBag works on Hash-2";
365+
isa_ok (@a, %x).KeyBag, KeyBag, "Method .KeyBag works on Parcel-1";
366+
is showkv((@a, %x).KeyBag), "Now:1 Paradise:1 a:1 b:2 cross-handed:1 set:1 the:2 was:1 way:1",
367+
"Method .KeyBag works on Parcel-2";
368+
}
369+
353370
# vim: ft=perl6

0 commit comments

Comments
 (0)