Patchwork [4,of,4] tests: Solaris grep doesn't add a trailing newline when it's missing

login
register
mail settings
Submitter Danek Duvall
Date March 2, 2016, 11:22 p.m.
Message ID <c409aaec7a3ff2323d35.1456960943@smelly.us.oracle.com>
Download mbox | patch
Permalink /patch/13579/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Danek Duvall - March 2, 2016, 11:22 p.m.
# HG changeset patch
# User Danek Duvall <danek.duvall@oracle.com>
# Date 1456959701 28800
#      Wed Mar 02 15:01:41 2016 -0800
# Node ID c409aaec7a3ff2323d35bb1ad8b86cb19a8d3073
# Parent  4a15c707703d3adaadb595c96dc07638e6a746e8
tests: Solaris grep doesn't add a trailing newline when it's missing

The bad-extension tests emits a list of not-loaded extensions, and pipes
that output through grep.  On Solaris, the test-output gets "(no-eol)"
appended because although the message has no trailing newline, GNU grep
adds it.  If we simply add the newline to the message, the problem goes
away for both versions of grep.

Patch

diff --git a/tests/test-bad-extension.t b/tests/test-bad-extension.t
--- a/tests/test-bad-extension.t
+++ b/tests/test-bad-extension.t
@@ -39,7 +39,7 @@  names of extensions failed to load can b
   > command = cmdutil.command(cmdtable)
   > @command('showbadexts', norepo=True)
   > def showbadexts(ui, *pats, **opts):
-  >     ui.write('BADEXTS: %s' % ' '.join(sorted(extensions.notloaded())))
+  >     ui.write('BADEXTS: %s\n' % ' '.join(sorted(extensions.notloaded())))
   > EOF
   $ hg --config extensions.badexts=showbadexts.py showbadexts 2>&1 | grep '^BADEXTS'
   BADEXTS: badext badext2