projects/aports·blob master · refs

168 lines · 3.1 KiB

1diff --git a/MANIFEST b/MANIFEST
2index 50fbd62..2340454 100644
3--- a/MANIFEST
4+++ b/MANIFEST
5@@ -148,7 +148,6 @@ t/outline_line.t
6 t/output.t
7 t/parser.t
8 t/parser2.t
9-t/plugin_list.t
10 t/plugins.t
11 t/plugins_preloaded.t
12 t/plusfile.t
13diff --git a/t/plugin_list.t b/t/plugin_list.t
14deleted file mode 100644
15index 6943593..0000000
16--- a/t/plugin_list.t
17+++ /dev/null
18@@ -1,150 +0,0 @@
19-#============================================================= -*-perl-*-
20-#
21-# t/plugin_list.t
22-#
23-# Tests for the Template::Plugin::List module.
24-#
25-# Written by Koan <[email protected]>
26-#
27-# This is free software; you can redistribute it and/or modify it
28-# under the same terms as Perl itself.
29-#
30-#========================================================================
31-
32-use strict;
33-use warnings;
34-use lib qw( ./lib ../lib );
35-use Template::Test;
36-$^W = 1;
37-
38-$Template::Test::DEBUG = 0;
39-
40-test_expect(\*DATA);
41-
42-__DATA__
43-
44-# ---- construction from positional args ----
45--- test --
46-[% USE l = List(10, 20, 30) -%]
47-[% l.size %]
48--- expect --
49-3
50-
51--- test --
52-[% USE l = List(10, 20, 30) -%]
53-[% l.text %]
54--- expect --
55-10, 20, 30
56-
57-# ---- construction from arrayref ----
58--- test --
59-[% USE l = List([4, 5, 6]) -%]
60-[% l.text %]
61--- expect --
62-4, 5, 6
63-
64-# ---- construction from named 'list' param ----
65--- test --
66-[% USE l = List(list = [7, 8, 9]) -%]
67-[% l.text %]
68--- expect --
69-7, 8, 9
70-
71-# ---- custom joint ----
72--- test --
73-[% USE l = List(1, 2, 3, joint = ' | ') -%]
74-[% l.text %]
75--- expect --
76-1 | 2 | 3
77-
78-# ---- custom join (alias) ----
79--- test --
80-[% USE l = List(1, 2, 3, join = ' - ') -%]
81-[% l.text %]
82--- expect --
83-1 - 2 - 3
84-
85-# ---- item access ----
86--- test --
87-[% USE l = List('a', 'b', 'c') -%]
88-[% l.item(0) %] [% l.item(1) %] [% l.item(2) %]
89--- expect --
90-a b c
91-
92-# ---- size and max ----
93--- test --
94-[% USE l = List(10, 20, 30, 40) -%]
95-size=[% l.size %] max=[% l.max %]
96--- expect --
97-size=4 max=3
98-
99-# ---- push ----
100--- test --
101-[% USE l = List(1, 2) -%]
102-[% CALL l.push(3, 4) -%]
103-[% l.text %]
104--- expect --
105-1, 2, 3, 4
106-
107-# ---- unshift ----
108--- test --
109-[% USE l = List(3, 4) -%]
110-[% CALL l.unshift(1, 2) -%]
111-[% l.text %]
112--- expect --
113-1, 2, 3, 4
114-
115-# ---- pop ----
116--- test --
117-[% USE l = List(1, 2, 3) -%]
118-[% CALL l.pop -%]
119-[% l.text %]
120--- expect --
121-1, 2
122-
123-# ---- shift ----
124--- test --
125-[% USE l = List(1, 2, 3) -%]
126-[% CALL l.shift -%]
127-[% l.text %]
128--- expect --
129-2, 3
130-
131-# ---- string interpolation ----
132--- test --
133-[% USE l = List('x', 'y') -%]
134-list is: [% l %]
135--- expect --
136-list is: x, y
137-
138-# ---- copy produces independent list ----
139--- test --
140-[% USE l = List(1, 2, 3) -%]
141-[% m = l.copy -%]
142-[% CALL m.push(4) -%]
143-orig=[% l.size %] copy=[% m.size %]
144--- expect --
145-orig=3 copy=4
146-
147-# ---- empty list ----
148--- test --
149-[% USE l = List -%]
150-size=[% l.size %] text=[% l.text %]
151--- expect --
152-size=0 text=
153-
154-# ---- hash ----
155--- test --
156-[% USE l = List('a', 'b', 'c') -%]
157-[% h = l.hash -%]
158-[% h.0 %] [% h.1 %] [% h.2 %]
159--- expect --
160-a b c
161-
162-# ---- list accessor ----
163--- test --
164-[% USE l = List(10, 20, 30) -%]
165-[% data = l.list -%]
166-[% data.0 %] [% data.2 %]
167--- expect --
168-10 30