File: 23__Create_Href.t

package info (click to toggle)
libpetal-utils-perl 0.06-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 384 kB
  • sloc: perl: 935; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 693 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/perl

##
## Tests for Petal::Utils::CreateHref module
##

use strict;

use Test::More qw(no_plan);
use Carp;

use t::LoadPetal;
use Petal::Utils qw( :uri );

my $url1 = 'http://www.foo.com';
my $url2 = 'www.foo.com';
my $url3 = 'ftp://ftp.foo.com';
my $url4 = 'ftp.foo.com';

my $template = Petal->new('23__create_href.html');
my $out      = $template->process( {
    url1 => $url1,
    url2 => $url2,
    url3 => $url3,
    url4 => $url4,
  } );

like($out, qr!create_href1: <a href="$url1"!, 'url1');
like($out, qr!create_href2: <a href="http://$url2"!, 'url2');
like($out, qr!create_href3: <a href="$url3"!, 'url3');
like($out, qr!create_href4: <a href="ftp://$url4"!, 'url4');