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