Lines Matching +full:open +full:- +full:source
1 #!perl -T
2 # Tests for taint-mode features
13 …or all versions up to at least 0.2308) is currently bugged under MSWin32/taint mode [as of 2018-09]
15 …# ref: [File-Temp: Fails under -T, Windows 7, Strawberry Perl 5.12.1](https://rt.cpan.org/Public/B…
20 my $tmpfile = File::Temp->new;
21 my $file = $tmpfile->filename;
32 open my $fh, '>', $file or die "Couldn't write temporary file $file: $!";
37 my $obj = Text::Template->new(@_);
38 eval { $obj->fill_in() };
48 my $obj = Text::Template->new(@_);
49 eval { $obj->fill_in() };
71 # (2)-(7)
76 should_fail TYPE => 'file', SOURCE => $tfile;
77 should_fail TYPE => 'file', SOURCE => $tfile, UNTAINT => 1;
78 should_fail TYPE => 'file', SOURCE => $file;
79 should_work TYPE => 'file', SOURCE => $file, UNTAINT => 1;
81 # (8-9)
82 open $fh, '<', $file or die "Couldn't open $file for reading: $!; aborting";
83 should_fail TYPE => 'filehandle', SOURCE => $fh;
86 open $fh, '<', $file or die "Couldn't open $file for reading: $!; aborting";
87 should_work TYPE => 'filehandle', SOURCE => $fh, UNTAINT => 1;
90 # (10-15)
95 should_fail TYPE => 'string', SOURCE => $ttemplate;
96 should_fail TYPE => 'string', SOURCE => $ttemplate, UNTAINT => 1;
97 should_work TYPE => 'string', SOURCE => $template;
98 should_work TYPE => 'string', SOURCE => $template, UNTAINT => 1;
100 # (16-19)
103 should_fail TYPE => 'array', SOURCE => $tarray;
104 should_fail TYPE => 'array', SOURCE => $tarray, UNTAINT => 1;
105 should_work TYPE => 'array', SOURCE => $array;
106 should_work TYPE => 'array', SOURCE => $array, UNTAINT => 1;
108 # (20-21) Test _unconditionally_untaint utility function