VirtualBox

source: vbox/trunk/src/libs/openssl-3.1.7/external/perl/Text-Template-1.56/t/out.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: 1.1 KB
Line 
1#!perl
2#
3# test apparatus for Text::Template module
4# still incomplete.
5#
6
7use strict;
8use warnings;
9use Test::More tests => 4;
10
11use_ok 'Text::Template' or exit 1;
12
13my $templateIN = q{
14This line should have a 3: {1+2}
15
16This line should have several numbers:
17{ $t = ''; foreach $n (1 .. 20) { $t .= $n . ' ' } $t }
18};
19
20my $templateOUT = q{
21This line should have a 3: { $OUT = 1+2 }
22
23This line should have several numbers:
24{ foreach $n (1 .. 20) { $OUT .= $n . ' ' } }
25};
26
27# Build templates from string
28my $template = Text::Template->new('type' => 'STRING', 'source' => $templateIN);
29isa_ok $template, 'Text::Template';
30
31$templateOUT = Text::Template->new('type' => 'STRING', 'source' => $templateOUT);
32isa_ok $templateOUT, 'Text::Template';
33
34# Fill in templates
35my $text = $template->fill_in();
36my $textOUT = $templateOUT->fill_in();
37
38# (1) They should be the same
39is $text, $textOUT;
40
41# Missing: Test this feature in Safe compartments;
42# it's a totally different code path.
43# Decision: Put that into safe.t, because that file should
44# be skipped when Safe.pm is unavailable.
45
46exit;
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