ACIL FM
Dark
Refresh
Current DIR:
/usr/share/doc/perl-Test-Simple/t/Legacy/Tester
/
usr
share
doc
perl-Test-Simple
t
Legacy
Tester
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
tbt_01basic.t
1.24 MB
chmod
View
DL
Edit
Rename
Delete
tbt_02fhrestore.t
1.17 MB
chmod
View
DL
Edit
Rename
Delete
tbt_03die.t
225 B
chmod
View
DL
Edit
Rename
Delete
tbt_04line_num.t
196 B
chmod
View
DL
Edit
Rename
Delete
tbt_05faildiag.t
824 B
chmod
View
DL
Edit
Rename
Delete
tbt_06errormess.t
3.02 MB
chmod
View
DL
Edit
Rename
Delete
tbt_07args.t
5.15 MB
chmod
View
DL
Edit
Rename
Delete
tbt_08subtest.t
268 B
chmod
View
DL
Edit
Rename
Delete
tbt_09do.t
603 B
chmod
View
DL
Edit
Rename
Delete
tbt_09do_script.pl
215 B
chmod
View
DL
Edit
Rename
Delete
Edit file: /usr/share/doc/perl-Test-Simple/t/Legacy/Tester/tbt_02fhrestore.t
#!/usr/bin/perl use Test::Builder::Tester tests => 4; use Test::More; use Symbol; # create temporary file handles that still point indirectly # to the right place my $orig_o = gensym; my $orig_t = gensym; my $orig_f = gensym; tie *$orig_o, "My::Passthru", \*STDOUT; tie *$orig_t, "My::Passthru", \*STDERR; tie *$orig_f, "My::Passthru", \*STDERR; # redirect the file handles to somewhere else for a mo use Test::Builder; my $t = Test::Builder->new(); $t->output($orig_o); $t->failure_output($orig_f); $t->todo_output($orig_t); # run a test test_out("ok 1 - tested"); ok(1,"tested"); test_test("standard test okay"); # now check that they were restored okay ok($orig_o == $t->output(), "output file reconnected"); ok($orig_t == $t->todo_output(), "todo output file reconnected"); ok($orig_f == $t->failure_output(), "failure output file reconnected"); ##################################################################### package My::Passthru; sub PRINT { my $self = shift; my $handle = $self->[0]; print $handle @_; } sub TIEHANDLE { my $class = shift; my $self = [shift()]; return bless $self, $class; } sub READ {} sub READLINE {} sub GETC {} sub FILENO {}
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply