Line ending normalizing is broken on WAMP

Created on 10 August 2015, almost 9 years ago
Updated 11 January 2024, 6 months ago

Problem description:

On WAMP machines, the TestDiscovery does not correctly parse the line endings. The result is a bunch of /n's in a long string of the test class description. I attached a screenshot , it's huge so I won't embed it here.

Proposed solution:

Fix the normalization of line endings to work on windows.
Now:

 // Normalize line endings.
    $doc_comment = preg_replace('/\r\n|\r/', '\n', $doc_comment);

My patch:

    // Normalize line endings.
    $doc_comment = str_replace('\r\n', '\n', $doc_comment);
    $doc_comment = str_replace('\r', '\n', $doc_comment);

And a screenshot of the fixed version is attached and linked .

UI Changes:

On windows, the Test discovery works again! See the screenshot above.

The rest:

None

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Base 

Last updated 1 minute ago

Created by

🇨🇭Switzerland LKS90

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

  • 🇮🇳India ranjith_kumar_k_u Kerala

    Rerolled #35

  • 🇮🇳India Hardik_Patel_12 India

    The test is unsuccessful because the code $info = TestDiscovery::getTestInfo($classname, $doc_comment); is returning "PHPUnit-" as the type in core/tests/Drupal/Tests/Core/Test/TestDiscoveryTest.php ,while the expectation is for simpletest.

Production build 0.69.0 2024