Skip to main content
  • Home
  • login
  • Browse the archive

    swh mirror partner logo
swh logo
SoftwareHeritage
Software
Heritage
Mirror
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • c6699af
  • /
  • external
  • /
  • perl
  • /
  • Text-Template-1.56
  • /
  • t
  • /
  • out.t
Raw File
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:a805c7108993bbc9445d9df56b4ac254334d2764
directory badge Iframe embedding
swh:1:dir:7f3413dd469356106299d911badbf763182377dc
out.t
#!perl
#
# test apparatus for Text::Template module
# still incomplete.
#

use strict;
use warnings;
use Test::More tests => 4;

use_ok 'Text::Template' or exit 1;

my $templateIN = q{
This line should have a 3: {1+2}

This line should have several numbers:
{ $t = ''; foreach $n (1 .. 20) { $t .= $n . ' ' } $t }
};

my $templateOUT = q{
This line should have a 3: { $OUT = 1+2 }

This line should have several numbers:
{ foreach $n (1 .. 20) { $OUT .= $n . ' ' } }
};

# Build templates from string
my $template = Text::Template->new('type' => 'STRING', 'source' => $templateIN);
isa_ok $template, 'Text::Template';

$templateOUT = Text::Template->new('type' => 'STRING', 'source' => $templateOUT);
isa_ok $templateOUT, 'Text::Template';

# Fill in templates
my $text    = $template->fill_in();
my $textOUT = $templateOUT->fill_in();

# (1) They should be the same
is $text, $textOUT;

# Missing:  Test this feature in Safe compartments;
# it's a totally different code path.
# Decision: Put that into safe.t, because that file should
# be skipped when Safe.pm is unavailable.

exit;

ENEA — Copyright (C), ENEA. License: GNU AGPLv3+.
Legal notes  ::  JavaScript license information ::  Web API

back to top