summaryrefslogtreecommitdiff
path: root/lib/SelectSaver.t
diff options
context:
space:
mode:
Diffstat (limited to 'lib/SelectSaver.t')
-rwxr-xr-xlib/SelectSaver.t28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/SelectSaver.t b/lib/SelectSaver.t
new file mode 100755
index 0000000000..3b58d709ab
--- /dev/null
+++ b/lib/SelectSaver.t
@@ -0,0 +1,28 @@
+#!./perl
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
+print "1..3\n";
+
+use SelectSaver;
+
+open(FOO, ">foo-$$") || die;
+
+print "ok 1\n";
+{
+ my $saver = new SelectSaver(FOO);
+ print "foo\n";
+}
+
+# Get data written to file
+open(FOO, "foo-$$") || die;
+chomp($foo = <FOO>);
+close FOO;
+unlink "foo-$$";
+
+print "ok 2\n" if $foo eq "foo";
+
+print "ok 3\n";