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

  • a0723b2
  • /
  • external
  • /
  • perl
  • /
  • Text-Template-1.56
  • /
  • t
  • /
  • ofh.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:a490e7abe5512c6fa45eb1b1119d6b150957996d
directory badge Iframe embedding
swh:1:dir:7f3413dd469356106299d911badbf763182377dc
ofh.t
#!perl
#
# test apparatus for Text::Template module
# still incomplete.

use strict;
use warnings;
use Test::More tests => 3;
use File::Temp;

use_ok 'Text::Template' or exit 1;

my $template = Text::Template->new(
    TYPE   => 'STRING',
    SOURCE => q{My process ID is {$$}});

my $of = File::Temp->new;

my $text = $template->fill_in(OUTPUT => $of);

# (1) No $text should have been constructed.  Return value should be true.
is $text, '1';

close $of or die "close(): $!";

open my $ifh, '<', $of->filename or die "open($of): $!";

my $t;
{ local $/; $t = <$ifh> }
close $ifh;

# (2) The text should have been printed to the file
is $t, "My process ID is $$";

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

back to top