File: 01_clickable.t

package info (click to toggle)
libtemplate-plugin-clickable-perl 0.06-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 80 kB
  • sloc: perl: 38; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 1,046 bytes parent folder | download | duplicates (4)
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
33
34
35
use strict;
use Template::Test;

test_expect(\*DATA);

__END__
--test--
[% USE Clickable -%]
[% FILTER clickable -%]
http://www.template-toolkit.org/
[%- END %]
--expect--
<a href="http://www.template-toolkit.org/">http://www.template-toolkit.org/</a>

--test--
[% USE Clickable -%]
[% FILTER clickable target => '_blank' -%]
http://www.template-toolkit.org/
http://www.template-toolkit.org/
[%- END %]
--expect--
<a href="http://www.template-toolkit.org/" target="_blank">http://www.template-toolkit.org/</a>
<a href="http://www.template-toolkit.org/" target="_blank">http://www.template-toolkit.org/</a>

--test--
[% USE Clickable -%]
[% FILTER clickable target => '_blank', rel => 'nofollow' -%]
http://www.template-toolkit.org/
[%- END %]
[% FILTER clickable rel => 'nofollow' -%]
http://www.template-toolkit.org/
[%- END %]
--expect--
<a href="http://www.template-toolkit.org/" target="_blank" rel="nofollow">http://www.template-toolkit.org/</a>
<a href="http://www.template-toolkit.org/" rel="nofollow">http://www.template-toolkit.org/</a>