Skip to content

Conversation

@vbreuss
Copy link
Contributor

@vbreuss vbreuss commented Jan 20, 2024

As mentioned in #2566 treating the verbatim string @"\r\n" as a newline seems suspicius, as it is equivalent to "\\r\\n".

IMPORTANT

  • If the PR touches the public API, the changes have been approved in a separate issue with the "api-approved" label.
  • The code complies with the Coding Guidelines for C#.
  • The changes are covered by unit tests which follow the Arrange-Act-Assert syntax and the naming conventions such as is used in these tests.
  • If the PR adds a feature or fixes a bug, please update the release notes with a functional description that explains what the change means to consumers of this library, which are published on the website.
  • If the PR changes the public API the changes needs to be included by running AcceptApiChanges.ps1 or AcceptApiChanges.sh.
  • If the PR affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
    • Please also run ./build.sh --target spellcheck or .\build.ps1 --target spellcheck before pushing and check the good outcome

@vbreuss vbreuss changed the title Avoid treating @"\r\n" as new line. Avoid treating "\\r\\n" as new line. Jan 20, 2024
@vbreuss
Copy link
Contributor Author

vbreuss commented Jan 20, 2024

This code was added a long time ago in #84 (see here).

@github-actions
Copy link

Qodana for .NET

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@vbreuss vbreuss marked this pull request as ready for review January 20, 2024 05:23
@coveralls
Copy link

coveralls commented Jan 20, 2024

Pull Request Test Coverage Report for Build 7664903396

Warning: This coverage report may be inaccurate.

We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
To ensure accuracy in future PRs, please see these guidelines.
A quick fix for this PR: rebase it; your next report should be accurate.

  • 0 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 97.463%

Totals Coverage Status
Change from base Build 7582822005: 0.0%
Covered Lines: 11944
Relevant Lines: 12129

💛 - Coveralls

@dennisdoomen dennisdoomen requested a review from jnyrup January 24, 2024 18:36
@dennisdoomen
Copy link
Member

I think the title is misleading. You're merely removing some code that doesn't do anything.

@vbreuss
Copy link
Contributor Author

vbreuss commented Jan 25, 2024

I think the title is misleading. You're merely removing some code that doesn't do anything.

Not really. The following test failed previously, but now no longer:

        [Fact]
        public void Does_not_treat_escaped_newlines_as_newlines()
        {
            // Arrange
            string actual = "te\r\nst";
            string expect = "te\\r\\nst";

            // Act / Assert
            actual.Should().NotMatchEquivalentOf(expect);
        }

image

Do you think it makes sense, to add this as a unit test?

@dennisdoomen
Copy link
Member

Not really. The following test failed previously, but now no longer

Ah, in that case, you're right and this is actually fixing a bug. Probably also needs a release notes entry then.

@github-actions
Copy link

Qodana for .NET

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@jnyrup jnyrup merged commit 5322b92 into fluentassertions:develop Feb 1, 2024
@vbreuss vbreuss deleted the topic/remove-incorrect-verbatim-replacement branch February 1, 2024 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants