[PATCH] tests: drop an unnecessary redirect to /dev/null

Matt Harbison mharbison72 at gmail.com
Tue Aug 21 02:06:53 UTC 2018


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1534817062 14400
#      Mon Aug 20 22:04:22 2018 -0400
# Node ID c17fc7f1b96ac9f847f5e904c1331c29060ec9cd
# Parent  f85b256082527ab729cd480c21a310127b42eb2e
tests: drop an unnecessary redirect to /dev/null

This eliminates the need to conditionalize the color output, because NUL on
Windows is a tty.  Credit to Yuya for recognizing this.

diff --git a/tests/test-extension.t b/tests/test-extension.t
--- a/tests/test-extension.t
+++ b/tests/test-extension.t
@@ -1254,11 +1254,9 @@ Broken disabled extension and command:
   > def g():
   >     pass
   > EOF
-  $ hg --config extensions.path=./path.py help foo > /dev/null
-  abort: no such help topic: foo (no-windows !)
-  (try 'hg help --keyword foo') (no-windows !)
-  \x1b[0;31mabort: no such help topic: foo\x1b[0m (esc) (windows !)
-  \x1b[0;31m(try 'hg help --keyword foo')\x1b[0m (esc) (windows !)
+  $ hg --config extensions.path=./path.py help foo
+  abort: no such help topic: foo
+  (try 'hg help --keyword foo')
   [255]
 
   $ cat > throw.py <<EOF
diff --git a/tests/test-help.t b/tests/test-help.t
--- a/tests/test-help.t
+++ b/tests/test-help.t
@@ -1480,11 +1480,9 @@ Test -e / -c / -k combinations
   Commands:
   $ hg help -c commit > /dev/null
   $ hg help -e -c commit > /dev/null
-  $ hg help -e commit > /dev/null
-  abort: no such help topic: commit (no-windows !)
-  (try 'hg help --keyword commit') (no-windows !)
-  \x1b[0;31mabort: no such help topic: commit\x1b[0m (esc) (windows !)
-  \x1b[0;31m(try 'hg help --keyword commit')\x1b[0m (esc) (windows !)
+  $ hg help -e commit
+  abort: no such help topic: commit
+  (try 'hg help --keyword commit')
   [255]
 
 Test keyword search help


More information about the Mercurial-devel mailing list