Parent Directory
|
Revision Log
simple links to current page with one param
1 | dpavlin | 110 | #!/usr/bin/perl |
2 | use strict; | ||
3 | use warnings; | ||
4 | |||
5 | my $debug = shift @ARGV; | ||
6 | |||
7 | use Test::More tests => 7; | ||
8 | use lib 'lib'; | ||
9 | |||
10 | use Data::Dump qw/dump/; | ||
11 | |||
12 | BEGIN { | ||
13 | use_ok('Frey::Web::Links'); | ||
14 | use_ok('Strix::User'); | ||
15 | } | ||
16 | |||
17 | ok( my $u = Frey::Web::Links->new( | ||
18 | name => 'foo', | ||
19 | current => 3, | ||
20 | values => [ 1 .. 5 ], | ||
21 | delimiter => '!', | ||
22 | ), 'new' ); | ||
23 | |||
24 | diag dump( $u ) if $debug; | ||
25 | |||
26 | ok( my $h = $u->links, 'links' ); | ||
27 | diag $h if $debug; | ||
28 | |||
29 | cmp_ok( $h, 'eq', | ||
30 | '<a href="?foo=1">1</a>!<a href="?foo=2">2</a>!<em>3</em>!<a href="?foo=4">4</a>!<a href="?foo=5">5</a>' | ||
31 | , 'markup' ); | ||
32 | |||
33 | ok( my @l = $u->links, 'links as array' ); | ||
34 | cmp_ok( scalar @l, '==', 5, '5 links' ); |
Name | Value |
---|---|
svn:executable | * |
ViewVC Help | |
Powered by ViewVC 1.1.26 |