Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ff41d5c130
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 56 lines (45 sloc) 1.26 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 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
use v6;

use Test;

=begin pod

This file was derived from the perl5 CPAN module Perl6::Rules,
version 0.3 (12 Apr 2004), file t/anchors.t.

It has (hopefully) been, and should continue to be, updated to
be valid perl6.

=end pod

# L<S05/New metacharacters/"^^ and $$ match line beginnings and endings">

plan 19;

my $str = q{abc
def
ghi};

#?pugs todo
ok( $str ~~ m/^abc/, 'SOS abc' );
ok(!( $str ~~ m/^bc/ ), 'SOS bc' );
#?pugs todo
ok( $str ~~ m/^^abc/, 'SOL abc' );
ok(!( $str ~~ m/^^bc/ ), 'SOL bc' );
#?pugs todo
ok( $str ~~ m/abc\n?$$/, 'abc newline EOL' );
#?pugs todo
ok( $str ~~ m/abc$$/, 'abc EOL' );
ok(!( $str ~~ m/ab$$/ ), 'ab EOL' );
ok(!( $str ~~ m/abc$/ ), 'abc EOS' );
ok(!( $str ~~ m/^def/ ), 'SOS def' );
#?pugs todo
ok( $str ~~ m/^^def/, 'SOL def' );
#?pugs todo
ok( $str ~~ m/def\n?$$/, 'def newline EOL' );
#?pugs todo
ok( $str ~~ m/def$$/, 'def EOL' );
ok(!( $str ~~ m/def$/ ), 'def EOS' );
ok(!( $str ~~ m/^ghi/ ), 'SOS ghi' );
#?pugs todo
ok( $str ~~ m/^^ghi/, 'SOL ghi' );
#?pugs todo
ok( $str ~~ m/ghi\n?$$/, 'ghi newline EOL' );
#?pugs todo
ok( $str ~~ m/ghi$$/, 'ghi EOL' );
#?pugs todo
ok( $str ~~ m/ghi$/, 'ghi EOS' );
#?pugs todo
ok( $str ~~ m/^abc$$\n^^d.*f$$\n^^ghi$/, 'All dot' );

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