<div dir="ltr">Sorry I missed it earlier then - yeah, I'd expect them to be tested by forcing color on & verifying that the desired colour codes occur, etc. (maybe that's not feasible either - if the code is generic & doesn't always (or can't be requested to, using flags) produce the same ansi escape codes (but instead uses other platform-specific means of specifying colour changes))</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Feb 20, 2018 at 10:28 AM Adrian Prantl <<a href="mailto:aprantl@apple.com">aprantl@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space">Thus far we don't have any testcases for syntax highlighting, partially because we auto-detect if the terminal is a pipe an turn off syntax highlighting then. It can be forced on by passing --color, though. I guess we could start testing it...<div><br></div><div></div></div><div style="word-wrap:break-word;line-break:after-white-space"><div>-- adrian</div></div><div style="word-wrap:break-word;line-break:after-white-space"><div><br><div><br><blockquote type="cite"><div>On Feb 20, 2018, at 10:24 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br class="m_-1315306912625783150Apple-interchange-newline"><div><div dir="ltr">Test case?</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Feb 12, 2018 at 1:13 PM Adrian Prantl via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: adrian<br>
Date: Mon Feb 12 13:11:23 2018<br>
New Revision: 324936<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=324936&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=324936&view=rev</a><br>
Log:<br>
Fix the syntax highlighting of strings in dwarfdump.<br>
<br>
Modified:<br>
    llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp<br>
<br>
Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp?rev=324936&r1=324935&r2=324936&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp?rev=324936&r1=324935&r2=324936&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp (original)<br>
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp Mon Feb 12 13:11:23 2018<br>
@@ -587,10 +587,10 @@ void DWARFFormValue::dump(raw_ostream &O<br>
 void DWARFFormValue::dumpString(raw_ostream &OS) const {<br>
   Optional<const char *> DbgStr = getAsCString();<br>
   if (DbgStr.hasValue()) {<br>
-    raw_ostream &COS = WithColor(OS, syntax::String);<br>
-    COS << '"';<br>
-    COS.write_escaped(DbgStr.getValue());<br>
-    COS << '"';<br>
+    auto COS = WithColor(OS, syntax::String);<br>
+    COS.get() << '"';<br>
+    COS.get().write_escaped(DbgStr.getValue());<br>
+    COS.get() << '"';<br>
   }<br>
 }<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>
</div></blockquote></div><br></div></div></blockquote></div>