From 6a59f4b9c54d883f830b26be36371b32ce824d09 Mon Sep 17 00:00:00 2001
From: Darshit Shah <darnir@gmail.com>
Date: Tue, 12 Mar 2013 12:21:07 +0530
Subject: [PATCH] Add test to ensure correct return code on --post-file failure
 Signed-off-by: Darshit Shah <darnir@gmail.com>

---
 tests/Makefile.am        |  1 +
 tests/Test--post-file.px | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 100755 tests/Test--post-file.px

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9ff302c..12af7d2 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -119,6 +119,7 @@ EXTRA_DIST = FTPServer.pm FTPTest.pm HTTPServer.pm HTTPTest.pm \
              Test-O--no-content-disposition-trivial.px \
              Test-O-nonexisting.px \
              Test-O.px \
+	     Test--post-file.px \
              Test-proxied-https-auth.px \
              Test-proxy-auth-basic.px \
              Test-restrict-ascii.px \
diff --git a/tests/Test--post-file.px b/tests/Test--post-file.px
new file mode 100755
index 0000000..6420b95
--- /dev/null
+++ b/tests/Test--post-file.px
@@ -0,0 +1,24 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+use HTTPTest;
+
+
+###############################################################################
+
+my $cmdline = $WgetTest::WGETPATH . " -d --post-file=nofile http://localhost:{{port}}/";
+
+my $expected_error_code = 3;
+
+
+###############################################################################
+
+my $the_test = HTTPTest->new (name => "Test-missing-file",
+                              cmdline => $cmdline,
+                              errcode => $expected_error_code);
+exit $the_test->run();
+
+# vim: et ts=4 sw=4
+
-- 
1.8.1.5

