changeset 31964:ebaada96aec3

stdio: add Linux-specific tests for error checking
author Bryan O'Sullivan <bryano@fb.com>
date Tue, 11 Apr 2017 14:54:12 -0700
parents 1bfb9a63b98e
children 171de3152d50
files tests/hghave.py tests/test-basic.t
diffstat 2 files changed, 26 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/hghave.py	Tue Apr 11 14:54:12 2017 -0700
+++ b/tests/hghave.py	Tue Apr 11 14:54:12 2017 -0700
@@ -634,3 +634,7 @@
         return True
     except ImportError:
         return False
+
+@check("devfull", "/dev/full special file")
+def has_dev_full():
+    return os.path.exists('/dev/full')
--- a/tests/test-basic.t	Tue Apr 11 14:54:12 2017 -0700
+++ b/tests/test-basic.t	Tue Apr 11 14:54:12 2017 -0700
@@ -16,10 +16,31 @@
   $ hg init t
   $ cd t
 
-Make a changeset:
+Prepare a changeset:
 
   $ echo a > a
   $ hg add a
+
+  $ hg status
+  A a
+
+Writes to stdio succeed and fail appropriately
+
+#if devfull
+  $ hg status 2>/dev/full
+  A a
+
+  $ hg status >/dev/full
+  abort: No space left on device
+  [255]
+
+  $ hg status >/dev/full 2>&1
+  [1]
+
+  $ hg status ENOENT 2>/dev/full
+  [1]
+#endif
+
   $ hg commit -m test
 
 This command is ancient: