File: parser2.t

package info (click to toggle)
libtemplate-perl 2.27-1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 2,632 kB
  • sloc: perl: 14,750; makefile: 11; sh: 5
file content (43 lines) | stat: -rw-r--r-- 981 bytes parent folder | download
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
36
37
38
39
40
41
42
43
#============================================================= -*-perl-*-
#
# t/parser.t
#
# Test the Template::Parser module.
#
# Written by Colin Keith <ckeith@cpan.org>
#
# Copyright (C) 2012 Colin Keith. All Rights Reserved
# Copyright (C) 2012 Hagen Software, Inc.
#
# This is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
# $Id$
# 
#========================================================================

use strict;
use lib qw( . ../lib );
use Template::Test;
use Template::Config;
use Template::Parser;
$^W = 1;

#$Template::Test::DEBUG = 0;
#$Template::Test::PRESERVE = 1;
#$Template::Stash::DEBUG = 1;
#$Template::Parser::DEBUG = 1;
#$Template::Directive::PRETTY = 1;

my $p = Template::Parser->new();
my $expectedText = 'this is a test';
my($tokens) = $p->split_text(<<EOF);
[%

'$expectedText';
%]
EOF

is($tokens->[0]->[1], '3-4', 'Correctly exclude blank lines preceeding a directive from line number count');

1;