diff --git a/S02-types/bag.t b/S02-types/bag.t index d5c4c64e62..6d4324ee0a 100644 --- a/S02-types/bag.t +++ b/S02-types/bag.t @@ -1,7 +1,7 @@ use v6; use Test; -plan 106; +plan 103; sub showkv($x) { $x.keys.sort.map({ $^k ~ ':' ~ $x{$^k} }).join(' ') @@ -162,14 +162,11 @@ sub showkv($x) { } { - my $b = bag { foo => 10000000000, bar => 17, baz => 42 }; + my $b = bag { foo => 2, bar => 3, baz => 1 }; my $s; lives_ok { $s = $b.Str }, ".Str lives"; isa_ok $s, Str, "... and produces a string"; - ok $s.chars < 1000, "... of reasonable length"; - ok $s ~~ /foo/, "... which mentions foo"; - ok $s ~~ /bar/, "... which mentions bar"; - ok $s ~~ /baz/, "... which mentions baz"; + is $s.split(" ").sort.join(" "), "bar bar bar baz foo foo", "... which only contains bar baz and foo with the proper counts and separated by spaces"; } { diff --git a/S02-types/keybag.t b/S02-types/keybag.t index 30c54c81d1..dcc8b0701f 100644 --- a/S02-types/keybag.t +++ b/S02-types/keybag.t @@ -1,7 +1,7 @@ use v6; use Test; -plan 144; +plan 141; # L @@ -176,14 +176,11 @@ sub showkv($x) { } { - my $b = KeyBag.new({ foo => 10000000000, bar => 17, baz => 42 }); + my $b = KeyBag.new({ foo => 2, bar => 3, baz => 1 }); my $s; lives_ok { $s = $b.Str }, ".Str lives"; isa_ok $s, Str, "... and produces a string"; - ok $s.chars < 1000, "... of reasonable length"; - ok $s ~~ /foo/, "... which mentions foo"; - ok $s ~~ /bar/, "... which mentions bar"; - ok $s ~~ /baz/, "... which mentions baz"; + is $s.split(" ").sort.join(" "), "bar bar bar baz foo foo", "... which only contains bar baz and foo with the proper counts and separated by spaces"; } { diff --git a/S02-types/keyset.t b/S02-types/keyset.t index 42efefec86..1015d9f978 100644 --- a/S02-types/keyset.t +++ b/S02-types/keyset.t @@ -164,7 +164,7 @@ sub showset($s) { $s.keys.sort.join(' ') } } { - my $s = set ; + my $s = KeySet.new(); lives_ok { $s = $s.Str }, ".Str lives"; isa_ok $s, Str, "... and produces a string"; is $s.split(" ").sort.join(" "), "bar baz foo", "... which only contains bar baz and foo separated by spaces";