<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Dec 15, 2016 at 6:38 PM Zachary Turner via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">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">Tbh i was surprised there weren't more tests.  It seemed kind of arbitrary that only the various string cases had concatenation coverage.<br class="gmail_msg"><br class="gmail_msg">Is it safe to assume that if concatenation with empty works for each type, and a+b+c works for a single choice of a, b, and c that it works for any choice?<br class="gmail_msg"></blockquote><div><br></div><div>I think that's probably reasonable, yes - if the codepaths generally agree with that (it's possible there are quirks in the design that make that assumed orthogonality not actually orthogonal, for sure - in which case more detailed testing would be warranted).<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="gmail_msg">Also yes the laziness check should be easy to write a test for<br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Thu, Dec 15, 2016 at 6:15 PM David Blaikie via Phabricator <<a href="mailto:reviews@reviews.llvm.org" class="gmail_msg" target="_blank">reviews@reviews.llvm.org</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">dblaikie added a comment.<br class="gmail_msg">
<br class="gmail_msg">
Could you explain what makes each of the test cases interesting? (what they're testing that other test cases aren't) - it seems like a bit more testing than I'd expect, but I'm probably missing something about the mechanics of Twine.<br class="gmail_msg">
<br class="gmail_msg">
Also - would it be worth adding a test case to demonstrate that it truly is lazy? If you introduce a type with a custom printer that has a side effect (such as modifying the object as it prints) - then create a Twine of a formatv, observe the side effect hasn't occurred, then stringify the Twine and observe that the side effect has occurred.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://reviews.llvm.org/D27835" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D27835</a><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div>
_______________________________________________<br class="gmail_msg">
llvm-commits mailing list<br class="gmail_msg">
<a href="mailto:llvm-commits@lists.llvm.org" class="gmail_msg" target="_blank">llvm-commits@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="gmail_msg">
</blockquote></div></div>