"Fossies" - the Fresh Open Source Software Archive

Member "openssl-1.1.1b/external/perl/Text-Template-1.46/t/03-out.t" (26 Feb 2019, 1221 Bytes) of package /linux/misc/openssl-1.1.1b.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!perl
    2 #
    3 # test apparatus for Text::Template module
    4 # still incomplete.
    5 #
    6 
    7 use Text::Template;
    8 
    9 die "This is the test program for Text::Template version 1.46
   10 You are using version $Text::Template::VERSION instead.
   11 That does not make sense.\n
   12 Aborting"
   13   unless $Text::Template::VERSION == 1.46;
   14 
   15 print "1..1\n";
   16 
   17 $n=1;
   18 
   19 $template = q{
   20 This line should have a 3: {1+2}
   21 
   22 This line should have several numbers:
   23 { $t = ''; foreach $n (1 .. 20) { $t .= $n . ' ' } $t }
   24 };
   25 
   26 $templateOUT = q{
   27 This line should have a 3: { $OUT = 1+2 }
   28 
   29 This line should have several numbers:
   30 { foreach $n (1 .. 20) { $OUT .= $n . ' ' } }
   31 };
   32 
   33 # Build templates from string
   34 $template = new Text::Template ('type' => 'STRING', 'source' => $template)
   35   or die;
   36 $templateOUT = new Text::Template ('type' => 'STRING', 'source' => $templateOUT)
   37   or die;
   38 
   39 # Fill in templates
   40 $text = $template->fill_in()
   41   or die;
   42 $textOUT = $templateOUT->fill_in()
   43   or die;
   44 
   45 # (1) They should be the same
   46 print +($text eq $textOUT ? '' : 'not '), "ok $n\n";
   47 $n++;
   48 
   49 # Missing:  Test this feature in Safe compartments; 
   50 # it's a totally different code path.
   51 # Decision: Put that into safe.t, because that file should
   52 # be skipped when Safe.pm is unavailable.
   53 
   54 
   55 exit;
   56