Skip to content

Commit

Permalink
Add a test for Match to correctly coerce into Str
Browse files Browse the repository at this point in the history
There used to be a problem in Rakudo where Capture::Str was returning a
native `str` instead of Str.
  • Loading branch information
vrurg committed Nov 11, 2020
1 parent 5d709ef commit 89fa3e8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions S05-match/basics.t
@@ -0,0 +1,13 @@
use v6;
use Test;

plan 2;

{
my $m = "abc" ~~ /b/;
my Str(Match) $sm = $m;
isa-ok $sm, Str, "Match correctly coerces into Str";
is $sm, "b", "coerced string is as expected";
}

done-testing;
1 change: 1 addition & 0 deletions spectest.data
Expand Up @@ -427,6 +427,7 @@ S05-mass/recursive.t
S05-mass/rx.t
S05-mass/stdrules.t
S05-match/arrayhash.t
S05-match/basics.t
S05-match/blocks.t
S05-match/capturing-contexts.t
S05-match/make.t
Expand Down

0 comments on commit 89fa3e8

Please sign in to comment.