Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test for Match to correctly coerce into Str
There used to be a problem in Rakudo where Capture::Str was returning a native `str` instead of Str.
- Loading branch information
Showing
2 changed files
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters