summaryrefslogtreecommitdiff
path: root/lib/Temp/File-Temp-0.12/t/posix.t
diff options
context:
space:
mode:
authorAndreas Mair <amair.sob@googlemail.com>2005-03-21 11:57:02 +0100
committerAndreas Mair <amair.sob@googlemail.com>2005-03-21 11:57:02 +0100
commit5083c05ce2e2bfc5719346d809719ebf01b0e69d (patch)
tree71e65c65489eebc70a366006be250529a97b5410 /lib/Temp/File-Temp-0.12/t/posix.t
parent7525bed2d315a25ac2caf95ff0bf44c905d58a7e (diff)
downloadvdradmin-am-0.97-am2.tar.gz
vdradmin-am-0.97-am2.tar.bz2
2005-03-20: 0.97-am2v0.97-am2
- TV and remote templates have same remote control. Added patches: - fix for timers.conf of vdr1.3.23+ (Submitted by x-stefan @vdrportal.de) - Localnet Patch; no password request if client ip in given ip range) (Submitted by "Reiner Buehl" <reiner@buehl.net>) 2005-03-19: Templates cleanup: - timer_list.html - timer_new.html - toolbar.html - tv_flash.html - tv.html 2005-03-18: - reworked summary display of recordings - summary editbox preserves linefeeds while editing timers Templates cleanup: - prog_timeline.html - rc.html - rec_edit.html - rec_list.html 2005-03-12: - Added stream button in prog_summmary (suggested by Unimatrix0 @vdrportal.de) Templates cleanup: - at_new.html - at_timer_list.html - config.html - error.html - index.html - left.html - noauth.html - noperm.html - prog_details.html (TODO) - prog_list2.html - prog_list.html - prog_summary.html (TODO) Added patches: - vdradmin-0.96_For_vdr-1.3_StoreAutotimerChannelID_And_EventIdCheckDisable.diff (posted at the VDR mailinglist by "Rantanen Teemu" <teemu.rantanen@tekla.com>) - vdradmin-0.96_OneShot_Timers_English_Only.diff and merged it to "Deutsch" template (posted at the VDR mailinglist by "Rantanen Teemu" <teemu.rantanen@tekla.com>) - included changes from vdradmin-0.96-3-ctvdr-1 (see HISTORY.ct). Changes that have been forgotten while merging previous patches: - Fixed: timer listing now shows "VPS" instead of "Auto (alt)". - removed unneeded <br>. They are still used for display only.
Diffstat (limited to 'lib/Temp/File-Temp-0.12/t/posix.t')
-rwxr-xr-xlib/Temp/File-Temp-0.12/t/posix.t77
1 files changed, 77 insertions, 0 deletions
diff --git a/lib/Temp/File-Temp-0.12/t/posix.t b/lib/Temp/File-Temp-0.12/t/posix.t
new file mode 100755
index 0000000..b63fb29
--- /dev/null
+++ b/lib/Temp/File-Temp-0.12/t/posix.t
@@ -0,0 +1,77 @@
+#!/usr/local/bin/perl -w
+# Test for File::Temp - POSIX functions
+
+use strict;
+use Test;
+BEGIN { plan tests => 7}
+
+use File::Temp qw/ :POSIX unlink0 /;
+use FileHandle;
+ok(1);
+
+# TMPNAM - scalar
+
+print "# TMPNAM: in a scalar context: \n";
+my $tmpnam = tmpnam();
+
+# simply check that the file does not exist
+# Not a 100% water tight test though if another program
+# has managed to create one in the meantime.
+ok( !(-e $tmpnam ));
+
+print "# TMPNAM file name: $tmpnam\n";
+
+# TMPNAM list context
+# Not strict posix behaviour
+(my $fh, $tmpnam) = tmpnam();
+
+print "# TMPNAM: in list context: $fh $tmpnam\n";
+
+# File is opened - make sure it exists
+ok( (-e $tmpnam ));
+
+# Unlink it - a possible NFS issue again if TMPDIR is not a local disk
+my $status = unlink0($fh, $tmpnam);
+if ($status) {
+ ok( $status );
+} else {
+ skip("Skip test failed probably due to \$TMPDIR being on NFS",1);
+}
+
+# TMPFILE
+
+$fh = tmpfile();
+
+if (defined $fh) {
+ ok( $fh );
+ print "# TMPFILE: tmpfile got FH $fh\n";
+
+ $fh->autoflush(1) if $] >= 5.006;
+
+ # print something to it
+ my $original = "Hello a test\n";
+ print "# TMPFILE: Wrote line: $original";
+ print $fh $original
+ or die "Error printing to tempfile\n";
+
+ # rewind it
+ ok( seek($fh,0,0) );
+
+ # Read from it
+ my $line = <$fh>;
+
+ print "# TMPFILE: Read line: $line";
+ ok( $original, $line);
+
+ close($fh);
+
+} else {
+ # Skip all the remaining tests
+ foreach (1..3) {
+ skip("Skip test failed probably due to \$TMPDIR being on NFS",1);
+ }
+}
+
+
+
+