Skip to content
Newer
Older
100644 76 lines (60 sloc) 1.1 KB
e1ad160 @abw *** empty log message ***
authored Jul 7, 2000
1 #============================================================= -*-perl-*-
2 #
3 # t/case.t
4 #
5 # Test the CASE sensitivity option.
6 #
7 # Written by Andy Wardley <abw@kfs.org>
8 #
9 # Copyright (C) 1996-2000 Andy Wardley. All Rights Reserved.
10 # Copyright (C) 1998-2000 Canon Research Centre Europe Ltd.
11 #
12 # This is free software; you can redistribute it and/or modify it
13 # under the same terms as Perl itself.
14 #
15 # $Id$
16 #
17 #========================================================================
18
19 use strict;
20 use lib qw( ./lib ../lib );
21 use Template::Test;
22 $^W = 1;
23
24 $Template::Test::DEBUG = 0;
25
26 ok(1);
27
28 my $config = {
29 CASE => 1,
30 POST_CHOMP => 1,
31 };
32
33 test_expect(\*DATA, $config, callsign());
34
35 __DATA__
36 -- test --
37 [% include = a %]
38 [% for = b %]
39 i([% include %])
40 f([% for %])
41 -- expect --
42 i(alpha)
43 f(bravo)
44
45 -- test --
46 [% IF a AND b %]
47 good
48 [% ELSE %]
49 bad
50 [% END %]
51 -- expect --
52 good
53
54 -- test --
55 # 'and', 'or' and 'not' can ALWAYS be expressed in lower case, regardless
56 # of CASE sensitivity option.
57 [% IF a and b %]
58 good
59 [% ELSE %]
60 bad
61 [% END %]
62 -- expect --
63 good
64
65 -- test --
66 [% include = a %]
67 [% include %]
68 -- expect --
69 alpha
70
71
72
73
74
75
Something went wrong with that request. Please try again.