VirtualBox

source: vbox/trunk/src/libs/openssl-3.1.7/external/perl/Text-Template-1.56/t/ofh.t@ 107406

Last change on this file since 107406 was 104078, checked in by vboxsync, 11 months ago

openssl-3.1.5: Applied and adjusted our OpenSSL changes to 3.1.4. bugref:10638

File size: 665 bytes
Line 
1#!perl
2#
3# test apparatus for Text::Template module
4# still incomplete.
5
6use strict;
7use warnings;
8use Test::More tests => 3;
9use File::Temp;
10
11use_ok 'Text::Template' or exit 1;
12
13my $template = Text::Template->new(
14 TYPE => 'STRING',
15 SOURCE => q{My process ID is {$$}});
16
17my $of = File::Temp->new;
18
19my $text = $template->fill_in(OUTPUT => $of);
20
21# (1) No $text should have been constructed. Return value should be true.
22is $text, '1';
23
24close $of or die "close(): $!";
25
26open my $ifh, '<', $of->filename or die "open($of): $!";
27
28my $t;
29{ local $/; $t = <$ifh> }
30close $ifh;
31
32# (2) The text should have been printed to the file
33is $t, "My process ID is $$";
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette