-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] Code fix for NUnit2049 places the comma at a wrong place and messes up indentation #713
Comments
@Bartleby2718 I agree with your right formatting. CollectionAssert.AreEquivalent(
collection1,
collection2
);
Note that the newline after the comma is associated with the comma, not the arguments. Yes diving down it is possible to retrieve and maintain the original separator with it trailing newline. However. It gets even trickier if comments are used: CollectionAssert.AreEquivalent(
collection1, // expected
collection2 // actual
); The Assert.That(
collection2, // expected
Is.EqualTo(collection1),AsCollection // actual
); Keeping the trailing trivia with the argument results in: Assert.That(
collection2 // actual
, // expected
Is.EqualTo(collection1),AsCollection); Also not what you would want, The TrailingTrivia for collection2 parameter does not only contain the So to make this work for all possible combination to me seems to be a lot of work and still likely to go wrong. |
@manfred-brands Agree that there are many edge cases and it's not easy to cover all of them. However, the current behavior covers none of them, and handling whitespace correctly should be a decent win. |
is transformed into
There are two problems with this:
Similarly,
is transformed into
but I believe the right formatting should be
I believe fixing the former will also fix the latter.
The text was updated successfully, but these errors were encountered: