<div dir="ltr">Hello,<div>Not sure if this was missed or was just not really interesting.</div><div>Thanks,</div><div>Jean-Philippe</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-02-27 0:37 GMT+00:00 Jean-Philippe Dufraigne <span dir="ltr"><<a href="mailto:j.dufraigne@gmail.com" target="_blank">j.dufraigne@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The fix in r230473 was done to enable fixing the spacing for std::function<void( int, int )>.<br>
I did not realized that it also fixed this issue.<br>
<br>
Since it is fairly different from "Deleted &operator=(const Deleted &)& = default;" fixed in r230473, it seems sensible to add the regression test for it.<br>
<br>
Also cleaned up the test by removing duplicated code and comment, and kept repeated test set consistent.<br>
<br>
Result of running the new tests with r230473 backed out:<br>
  [ RUN      ] FormatTest.ConfigurableSpacesInParentheses<br>
  Actual: "std::function<void(int, int)> callback;"<br>
  Expected: "std::function<void( int, int )> callback;"<br>
  Actual: "std::function<void( int, int )> callback;"<br>
  Expected: "std::function<void(int, int)> callback;"<br>
  Actual: "std::function<void( int, int ) > callback;"<br>
  Expected: "std::function<void(int, int)> callback;"<br>
  [  FAILED  ] FormatTest.ConfigurableSpacesInParentheses (402 ms)<br>
<br>
Result of new tests with r230473:<br>
[ RUN      ] FormatTest.ConfigurableSpacesInParentheses<br>
[       OK ] FormatTest.ConfigurableSpacesInParentheses (209 ms)<br>
<br>
<a href="http://reviews.llvm.org/D7922" target="_blank">http://reviews.llvm.org/D7922</a><br>
<br>
Files:<br>
  unittests/Format/FormatTest.cpp<br>
<br>
Index: unittests/Format/FormatTest.cpp<br>
===================================================================<br>
--- unittests/Format/FormatTest.cpp<br>
+++ unittests/Format/FormatTest.cpp<br>
@@ -8148,6 +8148,8 @@<br>
<br>
   Spaces.SpacesInParentheses = true;<br>
   verifyFormat("call( x, y, z );", Spaces);<br>
+  verifyFormat("call();", Spaces);<br>
+  verifyFormat("std::function<void( int, int )> callback;", Spaces);<br>
   verifyFormat("while ( (bool)1 )\n"<br>
                "  continue;", Spaces);<br>
   verifyFormat("for ( ;; )\n"<br>
@@ -8174,19 +8176,13 @@<br>
   verifyFormat("my_int a = ( my_int )sizeof(int);", Spaces);<br>
   verifyFormat("#define x (( int )-1)", Spaces);<br>
<br>
-  Spaces.SpacesInParentheses = false;<br>
-  Spaces.SpaceInEmptyParentheses = true;<br>
-  verifyFormat("call(x, y, z);", Spaces);<br>
-  verifyFormat("call( )", Spaces);<br>
-<br>
-  // Run the first set of tests again with<br>
-  // Spaces.SpacesInParentheses = false,<br>
-  // Spaces.SpaceInEmptyParentheses = true and<br>
-  // Spaces.SpacesInCStyleCastParentheses = true<br>
+  // Run the first set of tests again with:<br>
   Spaces.SpacesInParentheses = false,<br>
   Spaces.SpaceInEmptyParentheses = true;<br>
   Spaces.SpacesInCStyleCastParentheses = true;<br>
   verifyFormat("call(x, y, z);", Spaces);<br>
+  verifyFormat("call( );", Spaces);<br>
+  verifyFormat("std::function<void(int, int)> callback;", Spaces);<br>
   verifyFormat("while (( bool )1)\n"<br>
                "  continue;", Spaces);<br>
   verifyFormat("for (;;)\n"<br>
@@ -8203,8 +8199,11 @@<br>
                "  break;\n"<br>
                "}", Spaces);<br>
<br>
+  // Run the first set of tests again with:<br>
   Spaces.SpaceAfterCStyleCast = true;<br>
   verifyFormat("call(x, y, z);", Spaces);<br>
+  verifyFormat("call( );", Spaces);<br>
+  verifyFormat("std::function<void(int, int)> callback;", Spaces);<br>
   verifyFormat("while (( bool ) 1)\n"<br>
                "  continue;",<br>
                Spaces);<br>
@@ -8225,6 +8224,8 @@<br>
                "  break;\n"<br>
                "}",<br>
                Spaces);<br>
+<br>
+  // Run subset of tests again with:<br>
   Spaces.SpacesInCStyleCastParentheses = false;<br>
   Spaces.SpaceAfterCStyleCast = true;<br>
   verifyFormat("while ((bool) 1)\n"<br>
<br>
EMAIL PREFERENCES<br>
  <a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
</blockquote></div><br></div>