Skip to content

Commit

Permalink
Cleaned up t/language tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abw committed Feb 9, 2012
1 parent ddbe378 commit 2c7d4e4
Show file tree
Hide file tree
Showing 13 changed files with 115 additions and 91 deletions.
16 changes: 9 additions & 7 deletions t/language/args.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@
# Testing the passing of positional and named arguments to sub-routines
# and object methods.
#
# Run with -h option for help.
#
# Written by Andy Wardley <abw@wardley.org>
#
# Copyright (C) 1996-2008 Andy Wardley. All Rights Reserved.
# Copyright (C) 1996-2012 Andy Wardley. All Rights Reserved.
#
# This is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
#========================================================================

use strict;
use warnings;
use lib qw( ./lib ../lib ../../lib );
use Badger
lib => '../../lib ../../blib/arch';

use Template::TT2::Test
tests => 7,
debug => 'Template::TT2::Parser',
args => \@ARGV;
tests => 7,
debug => 'Template::TT2::Parser',
args => \@ARGV;

use Template::TT2::Constants ':status';

Expand Down
16 changes: 9 additions & 7 deletions t/language/binop.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@
# Template script testing the conditional binary operators: and/&&, or/||,
# not/!, <, >, <=, >= , == and !=.
#
# Run with -h option for help.
#
# Written by Andy Wardley <abw@wardley.org>
#
# Copyright (C) 1996-2008 Andy Wardley. All Rights Reserved.
# Copyright (C) 1996-2012 Andy Wardley. All Rights Reserved.
#
# This is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
#========================================================================

use strict;
use warnings;
use lib qw( ./lib ../lib ../../lib );
use Badger
lib => '../../lib ../../blib/arch';

use Template::TT2::Test
tests => 25,
debug => 'Template::TT2::Parser',
args => \@ARGV;
tests => 25,
debug => 'Template::TT2::Parser',
args => \@ARGV;


my $counter = 0;
Expand Down
16 changes: 9 additions & 7 deletions t/language/capture.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@
# Test that the output from a directive block can be assigned to a
# variable.
#
# Run with -h option for help.
#
# Written by Andy Wardley <abw@wardley.org>
#
# Copyright (C) 1996-2008 Andy Wardley. All Rights Reserved.
# Copyright (C) 1996-2012 Andy Wardley. All Rights Reserved.
#
# This is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
#========================================================================

use strict;
use warnings;
use lib qw( ./lib ../lib ../../lib );
use Badger
lib => '../../lib ../../blib/arch';

use Template::TT2::Test
tests => 5,
debug => 'Template::TT2::Parser',
args => \@ARGV;
tests => 5,
debug => 'Template::TT2::Parser',
args => \@ARGV;

my $config = {
POST_CHOMP => 1,
Expand Down
24 changes: 13 additions & 11 deletions t/language/directives.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,30 @@
#
# Test basic directive layout and processing options.
#
# Run with -h option for help.
#
# Written by Andy Wardley <abw@wardley.org>
#
# Copyright (C) 1996-2008 Andy Wardley. All Rights Reserved.
# Copyright (C) 1996-2012 Andy Wardley. All Rights Reserved.
#
# This is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
#========================================================================

use strict;
use warnings;
use lib qw( ./lib ../lib ../../lib );
use Template::TT2::Test
tests => 35,
debug => 'Template::TT2::Parser',
args => \@ARGV;
use Badger
lib => '../../lib ../../blib/arch',
Filesystem => 'Bin';

use Badger::Filesystem '$Bin Dir';
use constant ENGINE => 'Template::TT2';
use Template::TT2::Test
tests => 35,
debug => 'Template::TT2::Parser',
args => \@ARGV;

my $tdir = Dir($Bin, 'templates')->must_exist;
use constant
ENGINE => 'Template::TT2';

my $tdir = Bin->dir('templates')->must_exist;
my $engines = {
tt => ENGINE->new(),
pre => ENGINE->new( PRE_CHOMP => 1 ),
Expand Down
14 changes: 8 additions & 6 deletions t/language/expose.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,27 @@
#
# Test EXPOSE_BLOCKS option
#
# Run with -h option for help.
#
# Written by Andy Wardley <abw@wardley.org>
#
# Copyright (C) 1996-2008 Andy Wardley. All Rights Reserved.
# Copyright (C) 1996-2012 Andy Wardley. All Rights Reserved.
#
# This is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
#========================================================================

use strict;
use warnings;
use lib qw( ./lib ../lib ../../lib );
use Badger
lib => '../../lib ../../blib/arch',
Filesystem => 'Bin';

use Template::TT2::Test
tests => 5,
debug => 'Template::TT2',
args => \@ARGV;

use Badger::Filesystem '$Bin Dir';
my $tlib = Dir($Bin, 'templates');
my $tlib = Bin->dir('templates');

my $tt_shielded = Template::TT2->new(
INCLUDE_PATH => $tlib,
Expand Down
16 changes: 9 additions & 7 deletions t/language/list.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@
# Tests list references as variables, including virtual-methods such
# as first(), last(), etc.
#
# Run with -h option for help.
#
# Written by Andy Wardley <abw@wardley.org>
#
# Copyright (C) 1996-2008 Andy Wardley. All Rights Reserved.
# Copyright (C) 1996-2012 Andy Wardley. All Rights Reserved.
#
# This is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
#========================================================================

use strict;
use warnings;
use lib qw( ./lib ../lib ../../lib );
use Badger
lib => '../../lib ../../blib/arch';

use Template::TT2::Test
tests => 19,
debug => 'Template::TT2::Stash',
args => \@ARGV;
tests => 19,
debug => 'Template::TT2::Stash',
args => \@ARGV;

use Template::TT2::Constants ':status';

Expand Down
10 changes: 6 additions & 4 deletions t/language/object.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@
#
# Template script testing code bindings to objects.
#
# Run with -h option for help.
#
# Written by Andy Wardley <abw@wardley.org>
#
# Copyright (C) 1996-2008 Andy Wardley. All Rights Reserved.
# Copyright (C) 1996-2012 Andy Wardley. All Rights Reserved.
#
# This is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
#========================================================================

use strict;
use warnings;
use lib qw( ./lib ../lib ../../lib );
use Badger
lib => '../../lib ../../blib/arch';

use Template::TT2::Test
tests => 23,
debug => 'Template::TT2::Stash',
Expand Down
14 changes: 8 additions & 6 deletions t/language/plusfile.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,28 @@
# Test ability to specify INCLUDE/PROCESS/WRAPPER files in the
# form "foo+bar+baz".
#
# Run with -h option for help.
#
# Written by Andy Wardley <abw@wardley.org>
#
# Copyright (C) 1996-2008 Andy Wardley. All Rights Reserved.
# Copyright (C) 1996-2012 Andy Wardley. All Rights Reserved.
#
# This is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
#========================================================================

use strict;
use warnings;
use lib qw( ./lib ../lib ../../lib );
use Badger
lib => '../../lib ../../blib/arch',
Filesystem => 'Bin';

use Template::TT2::Test
tests => 6,
debug => 'Template::TT2::Templates',
args => \@ARGV;

use Template::TT2 'TT2_MODULES';
use Badger::Filesystem '$Bin Dir';
my $tdir = Dir($Bin, 'templates', 'plusfile')->must_exist;
my $tdir = Bin->dir('templates', 'plusfile')->must_exist;

test_expect( config => { INCLUDE_PATH => $tdir });

Expand Down
11 changes: 4 additions & 7 deletions t/language/ref.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,19 @@
#
# Template script testing variable references.
#
# Run with -h option for help.
#
# Written by Andy Wardley <abw@wardley.org>
#
# Copyright (C) 1996-2008 Andy Wardley. All Rights Reserved.
# Copyright (C) 1996-2012 Andy Wardley. All Rights Reserved.
#
# This is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
#========================================================================

use Badger
lib => [
'../lib',
'../../lib',
'../../blib',
'../../blib/arch',
];
lib => '../../lib ../../blib/arch';

use Template::TT2::Test
tests => 6,
Expand Down
14 changes: 9 additions & 5 deletions t/language/text.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,29 @@
#
# Test general text blocks, ensuring all characters can be used.
#
# Run with -h option for help.
#
# Written by Andy Wardley <abw@wardley.org>
#
# Copyright (C) 1996-2008 Andy Wardley. All Rights Reserved.
# Copyright (C) 1996-2012 Andy Wardley. All Rights Reserved.
#
# This is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
#
#========================================================================

use strict;
use warnings;
use lib qw( ./lib ../lib ../../lib );

use Badger
lib => '../../lib ../../blib/arch';

use Template::TT2::Test
tests => 14,
debug => 'Template::TT2::Parser',
args => \@ARGV;

use constant ENGINE => 'Template::TT2';
use constant
ENGINE => 'Template::TT2';

#------------------------------------------------------------------------
package Stringy;
Expand Down
23 changes: 11 additions & 12 deletions t/language/tied.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,29 @@
#
# Written by Andy Wardley <abw@wardley.org>
#
# Copyright (C) 1996-2008 Andy Wardley. All Rights Reserved.
# Run with -h option for help.
#
# Copyright (C) 1996-2012 Andy Wardley. All Rights Reserved.
#
# This is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
#========================================================================

use Badger
lib => [
'../lib',
'../../lib',
'../../blib',
'../../blib/arch',
];
lib => '../../lib ../../blib/arch',
Filesystem => 'Bin';

use Template::TT2::Test
debug => 'Template::TT2::Parser',
args => \@ARGV;
debug => 'Template::TT2::Parser',
args => \@ARGV;

use constant
ENGINE => 'Template::TT2';

use Template::TT2::Stash;
use Template::TT2::Stash::Perl;
use Badger::Filesystem '$Bin Dir';
use constant ENGINE => 'Template::TT2';
my $dir = Dir($Bin, 'templates')->must_exist;
my $dir = Bin->dir('templates')->must_exist;
my $xs = Template::TT2::Stash->xs_backend;

# 2 runs if we don't have XS stash, 3 if we do
Expand Down
Loading

0 comments on commit 2c7d4e4

Please sign in to comment.