Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use utf8;
- use Test::More;
- use Mojo::UserAgent;
- use Data::Dump;
- use constant WIKI_SPACE_URL=> 'http://ru.wikipedia.org/wiki/%D0%9F%D1%80%D0%BE%D0%B1%D0%B5%D0%BB#.D0.94.D1.80.D1.83.D0.B3.D0.B8.D0.B5_.D0.BF.D1.80.D0.BE.D0.B1.D0.B5.D0.BB.D1.8B_.D0.B2_.D1.8E.D0.BD.D0.B8.D0.BA.D0.BE.D0.B4.D0.B5';
- binmode(STDOUT, ':utf8');
- subtest 'space test' => sub {
- my $ua = Mojo::UserAgent->new;
- $ua->get(WIKI_SPACE_URL)->res->dom('table.standard tr td:nth-child(2)')->each(sub {
- my $res = shift;
- like(pack('u',$res->text), qr/\s+/u, "unicode char: 0x" . $res->text);
- });
- };
- subtest 'digits test' => sub {
- while (<DATA>) {
- chop;
- my ($name,$range) = split / (?=\()/;
- $range =~ s/[\(\)]//g;
- subtest $name => sub {
- my ($from,$to) = split /-/,$range;
- like($_, qr/\d/, sprintf('unicode char: 0x%x',$_
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement