X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=lib%2Fopenssl%2Fexternal%2Fperl%2FText-Template-1.46%2Ft%2F03-out.t;fp=lib%2Fopenssl%2Fexternal%2Fperl%2FText-Template-1.46%2Ft%2F03-out.t;h=0ba65a54dc5e3153b5e0b671e4387e35a6442173;hb=02ed66432c92de70694700164f986190aad3cbc5;hp=0000000000000000000000000000000000000000;hpb=89016837dcbf2775cd15dc8cbaba00dc6379f86e;p=cassiopeia.git diff --git a/lib/openssl/external/perl/Text-Template-1.46/t/03-out.t b/lib/openssl/external/perl/Text-Template-1.46/t/03-out.t new file mode 100644 index 0000000..0ba65a5 --- /dev/null +++ b/lib/openssl/external/perl/Text-Template-1.46/t/03-out.t @@ -0,0 +1,56 @@ +#!perl +# +# test apparatus for Text::Template module +# still incomplete. +# + +use Text::Template; + +die "This is the test program for Text::Template version 1.46 +You are using version $Text::Template::VERSION instead. +That does not make sense.\n +Aborting" + unless $Text::Template::VERSION == 1.46; + +print "1..1\n"; + +$n=1; + +$template = q{ +This line should have a 3: {1+2} + +This line should have several numbers: +{ $t = ''; foreach $n (1 .. 20) { $t .= $n . ' ' } $t } +}; + +$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 +$template = new Text::Template ('type' => 'STRING', 'source' => $template) + or die; +$templateOUT = new Text::Template ('type' => 'STRING', 'source' => $templateOUT) + or die; + +# Fill in templates +$text = $template->fill_in() + or die; +$textOUT = $templateOUT->fill_in() + or die; + +# (1) They should be the same +print +($text eq $textOUT ? '' : 'not '), "ok $n\n"; +$n++; + +# 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; +