File: metamark.t

package info (click to toggle)
libwww-shorten-perl 3.03-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 312 kB
  • sloc: perl: 253; makefile: 7
file content (23 lines) | stat: -rw-r--r-- 581 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use Test::More tests => 7;

BEGIN { use_ok WWW::Shorten::Metamark };

SKIP: {
    skip 'network testing turned off by default', 6 if not $ENV{NETWORK_TESTING};

my $url = 'http://dave.org.uk/';
my $short = makeashorterlink( $url );
ok((defined $short), 'Reasonable response');
like ( $short => qr{^http://xrl\.us/\w+$}, 'make it shorter' );

is ( makealongerlink( $short ) => $url, 'make it longer' );

my ($rs) = $short =~ m# / (\w+) $ #x;
is ( makealongerlink($rs) => $url, 'make it longer by Id' );

eval { &makeashorterlink() };
ok($@);
eval { &makealongerlink() };
ok($@);

}