tests: conditionalize color output on abort
authorMatt Harbison <matt_harbison@yahoo.com>
Sat, 18 Aug 2018 15:15:04 -0400
changeset 39190 68b6383a840a
parent 39189 2dfc22620a54
child 39191 5517d62c1bcc
tests: conditionalize color output on abort This broke in afc4ad706f9c. I'm not sure why other aborts don't need to be conditionalized, but `hg help foo` does abort in red for both msys and cmd.exe.
tests/test-extension.t
tests/test-help.t
--- a/tests/test-extension.t	Sat Aug 18 14:03:11 2018 -0400
+++ b/tests/test-extension.t	Sat Aug 18 15:15:04 2018 -0400
@@ -1255,8 +1255,10 @@
   >     pass
   > EOF
   $ hg --config extensions.path=./path.py help foo > /dev/null
-  abort: no such help topic: foo
-  (try 'hg help --keyword foo')
+  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 !)
   [255]
 
   $ cat > throw.py <<EOF
--- a/tests/test-help.t	Sat Aug 18 14:03:11 2018 -0400
+++ b/tests/test-help.t	Sat Aug 18 15:15:04 2018 -0400
@@ -1481,8 +1481,10 @@
   $ 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
-  (try 'hg help --keyword commit')
+  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 !)
   [255]
 
 Test keyword search help