Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 51fc070843
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 25 lines (18 sloc) 0.687 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
use v6;
use Test;

plan 5;

# should be: L<S05/Bracket rationalization/"An B<explicit> reduction using the C<make> function">
# L<S05/Bracket rationalization/reduction using the>

"4" ~~ / (\d) { make $0.sqrt } Remainder /;
nok($/, 'No match');
#?niecza skip 'System.InvalidCastException: Cannot cast from source type to destination type.'
is($/.ast , 2);

# L<S05/Match objects/"Fortunately, when you just want to return a different">

"blah foo blah" ~~ / foo # Match 'foo'
                      { make 'bar' } # But pretend we matched 'bar'
                    /;
ok($/, 'matched');
#?rakudo todo '$()'
is($(), 'bar');
is $/.ast, 'bar', '$/.ast';

# vim: ft=perl6
Something went wrong with that request. Please try again.