~ubuntu-branches/ubuntu/precise/rakudo/precise

« back to all changes in this revision

Viewing changes to t/00-parrot/08-regex.t

  • Committer: Bazaar Package Importer
  • Author(s): Ryan Niebur
  • Date: 2009-10-04 14:31:57 UTC
  • Revision ID: james.westby@ubuntu.com-20091004143157-ubq3wu0grk0f1e6a
Tags: upstream-0.1~2009.09
ImportĀ upstreamĀ versionĀ 0.1~2009.09

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!./parrot perl6.pbc
 
2
 
 
3
# check basic regex capabilities
 
4
 
 
5
use v6;
 
6
 
 
7
say '1..11';
 
8
 
 
9
'abc' ~~ /abc/ and say 'ok 1';
 
10
'2' ~~ /^ \d+ $/ and say "ok ", $/;
 
11
 
 
12
my $rx = / <alpha> /;
 
13
'012a456' ~~ $rx and say 'ok 3';
 
14
 
 
15
my $l = 5;
 
16
my $r = 5;
 
17
$l   ~~ $r and say 'ok 4';
 
18
5    ~~ $r and say 'ok 5';
 
19
'5'  ~~ $r and say 'ok 6';
 
20
'25' ~~ $r or  say 'ok 7';
 
21
 
 
22
$r = / 5 /;
 
23
$l   ~~ $r and say 'ok 8';
 
24
5    ~~ $r and say 'ok 9';
 
25
'5'  ~~ $r and say 'ok 10';
 
26
'25' ~~ $r and say 'ok 11';
 
27
 
 
28