summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-11-13 00:23:44 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-11-13 00:23:44 +0000
commitd26ab924bbea5dd5379307deb59c11af3692350b (patch)
tree5c949beb264de6b467b4b3cd630d881f1715d64c
parent76dba3655eb7a077b1c64d5683e366041ec8ebf4 (diff)
downloadperl-d26ab924bbea5dd5379307deb59c11af3692350b.tar.gz
Couple of tests from #7660 salvaged.
p4raw-id: //depot/perl@7664
-rw-r--r--MANIFEST1
-rwxr-xr-xt/io/tell.t12
-rw-r--r--t/op/tell.t53
3 files changed, 11 insertions, 55 deletions
diff --git a/MANIFEST b/MANIFEST
index 31611689fd..eb1ec5cd58 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1554,7 +1554,6 @@ t/op/subst_wamp.t See if substitution works with $& present
t/op/substr.t See if substr works
t/op/sysio.t See if sysread and syswrite work
t/op/taint.t See if tainting works
-t/op/tell.t See if tell works
t/op/tie.t See if tie/untie functions work
t/op/tiearray.t See if tie for arrays works
t/op/tiehandle.t See if tie for handles works
diff --git a/t/io/tell.t b/t/io/tell.t
index b89aefb230..560836d5e0 100755
--- a/t/io/tell.t
+++ b/t/io/tell.t
@@ -2,7 +2,7 @@
# $RCSfile: tell.t,v $$Revision$$Date$
-print "1..21\n";
+print "1..23\n";
$TST = 'tst';
@@ -82,3 +82,13 @@ if ($. == $curline) { print "ok 20\n"; } else { print "not ok 20\n"; }
tell other;
if ($. == 7) { print "ok 21\n"; } else { print "not ok 21\n"; }
}
+
+close(other);
+if (tell(other) == -1) { print "ok 22\n"; } else { print "not ok 22\n"; }
+
+if (tell(ether) == -1) { print "ok 23\n"; } else { print "not ok 23\n"; }
+
+# ftell(STDIN) (or any std streams) is undefined, it can return -1 or
+# something else. ftell() on pipes, fifos, and sockets is defined to
+# return -1.
+
diff --git a/t/op/tell.t b/t/op/tell.t
deleted file mode 100644
index a4500d1947..0000000000
--- a/t/op/tell.t
+++ /dev/null
@@ -1,53 +0,0 @@
-#!./perl
-
-BEGIN {
- chdir 't' if -d 't';
- @INC = '../lib';
-}
-
-# NOTE: we cannot use seek() here because using that *portably* would mean
-# using Fcntl and the principle is not to use any extensions in the t/op/*
-
-print "1..6\n";
-
-{
-no warnings 'io';
-print "not " unless tell(TEST) == -1;
-print "ok 1\n";
-}
-
-open(TEST, "TEST") || die "$0: failed to open 'TEST' for reading: $!\n";
-
-print "not " unless tell(TEST) == 0;
-print "ok 2\n";
-
-my ($s, $read);
-
-$read = read(TEST, $s, 2);
-
-$read == 2 || warn "$0: read() returned $read, expected 2\n";
-$s eq '#!' || warn "$0: read() read '$s', expected '#!'\n";
-
-print "not " unless tell(TEST) == 2;
-print "ok 3\n";
-
-print "not " unless tell() == 2;
-print "ok 4\n";
-
-my $TEST = 'TEST';
-
-print "not " unless tell($TEST) == 2;
-print "ok 5\n";
-
-close(TEST) || warn "$0: close() failed: $!\n";
-
-{
-no warnings 'io';
-print "not " unless tell(TEST) == -1;
-print "ok 6\n";
-}
-
-# ftell(STDIN) (or any std streams) is undefined, it can return -1 or
-# something else. ftell() on pipes, fifos, and sockets is defined to
-# return -1.
-