Re: [PATCH 9 of 9 v2] stdio: add Linux-specific tests for error checking

2017-04-14 Thread Sean Farley
Bryan O'Sullivan  writes:

> # HG changeset patch
> # User Bryan O'Sullivan 
> # Date 1491947652 25200
> #  Tue Apr 11 14:54:12 2017 -0700
> # Node ID 19530f1d18bc0b6697f2996f089c614548f90269
> # Parent  800f9ec2664e515d8ad807c0df1efaccda8ff5e5
> stdio: add Linux-specific tests for error checking

It seems like this series addresses Yuya's feedback, so this seems good
to me.


signature.asc
Description: PGP signature
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 9 of 9 v2] stdio: add Linux-specific tests for error checking

2017-04-13 Thread Bryan O'Sullivan
# HG changeset patch
# User Bryan O'Sullivan 
# Date 1491947652 25200
#  Tue Apr 11 14:54:12 2017 -0700
# Node ID 19530f1d18bc0b6697f2996f089c614548f90269
# Parent  800f9ec2664e515d8ad807c0df1efaccda8ff5e5
stdio: add Linux-specific tests for error checking

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -634,3 +634,7 @@ def has_zstd():
 return True
 except ImportError:
 return False
+
+@check("devfull", "/dev/full special file")
+def has_dev_full():
+return os.path.exists('/dev/full')
diff --git a/tests/test-basic.t b/tests/test-basic.t
--- a/tests/test-basic.t
+++ b/tests/test-basic.t
@@ -16,10 +16,31 @@ Create a repository:
   $ 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:
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel