Lines Matching full:template
13 use_ok 'Text::Template' or exit 1;
22 # (1) Construct temporary template file for testing
39 # (2) Build template from file
40 my $template = Text::Template->new('type' => 'FILE', 'source' => $TEMPFILE);
41 ok(defined $template) or diag $Text::Template::ERROR;
43 # (3) Fill in template from file
55 my $text = $template->fill_in('package' => 'X');
58 # (4) Fill in same template again
59 $text = $template->fill_in('package' => 'Y');
63 $text = Text::Template->fill_this_in($template_1, 'package' => 'X');
66 # (6) test creation of template from filehandle
69 $template = Text::Template->new(type => 'FILEHANDLE', source => $tmpl);
70 ok defined $template or diag $Text::Template::ERROR;
72 # (7) test filling in of template from filehandle
73 $text = $template->fill_in('package' => 'X');
76 # (8) test second fill_in on same template object
77 $text = $template->fill_in('package' => 'Y');
82 # (9) test creation of template from array
83 $template = Text::Template->new(
91 ok defined $template; # or diag $Text::Template::ERROR;
93 # (10) test filling in of template from array
94 $text = $template->fill_in('package' => 'X');
97 # (11) test second fill_in on same array template object
98 $text = $template->fill_in('package' => 'Y');
103 $tmpl = Text::Template->new(TYPE => 'STRING', SOURCE => 'B{"\\}"}C{"\\{"}D');
111 $tmpl = Text::Template->new(TYPE => 'STRING', SOURCE => qq{A{"\t"}B});
141 my $tmpl = Text::Template->new(TYPE => 'STRING', SOURCE => $test);
150 # (28) test creation of template from filehandle
153 $template = Text::Template->new(type => 'FILEHANDLE', source => $tmpl);
154 ok(defined $template) or diag $Text::Template::ERROR;
156 # (29) test filling in of template from filehandle
157 $text = $template->fill_in('package' => 'X');
160 # (30) test second fill_in on same template object
161 $text = $template->fill_in('package' => 'Y');
167 $Text::Template::GEN0::test = 1;
168 Text::Template::_scrubpkg('Text::Template::GEN0');
169 ok !($Text::Template::GEN0::test
170 || exists $Text::Template::GEN0::{test}
171 || exists $Text::Template::{'GEN0::'});
174 $text = Text::Template->new(