Skip to content

Normalize line endings in assertions - #334

Merged
swissspidy merged 3 commits into
mainfrom
fix/normalize-line-endings
Jun 10, 2026
Merged

Normalize line endings in assertions#334
swissspidy merged 3 commits into
mainfrom
fix/normalize-line-endings

Conversation

@swissspidy

Copy link
Copy Markdown
Member

No description provided.

@github-actions github-actions Bot added os:windows scope:testing Related to testing labels Jun 10, 2026
@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 42 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Context/ThenStepDefinitions.php 0.00% 23 Missing ⚠️
src/Context/Support.php 0.00% 19 Missing ⚠️

📢 Thoughts on this report? Let us know!

@swissspidy
swissspidy marked this pull request as ready for review June 10, 2026 22:19
@swissspidy
swissspidy requested a review from a team as a code owner June 10, 2026 22:19
Copilot AI review requested due to automatic review settings June 10, 2026 22:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves cross-platform reliability of the WP-CLI Behat test suite by normalizing line endings (CRLF → LF) before performing various output/file assertions, reducing failures when command output differs by OS.

Changes:

  • Normalize line endings in string comparisons and multiple Then-step assertions (numeric, tables, JSON/YAML/CSV, regex, file reads).
  • Add helper utilities to normalize line endings recursively within decoded JSON/YAML structures.
  • Add/adjust feature coverage to validate line-ending normalization behavior and tweak an HTTP mocking step command quoting.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/Context/ThenStepDefinitions.php Normalizes STDOUT/STDERR and file contents before several assertions (tables/JSON/YAML/CSV/regex/numeric/version).
src/Context/Support.php Normalizes line endings in check_string() comparisons and adds normalization helpers (string + recursive data).
features/http-mocking.feature Adjusts quoting in a wp eval invocation.
features/behat-steps.feature Adds a scenario covering CRLF normalization across multiple assertion types.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Context/Support.php
@swissspidy swissspidy added this to the 5.1.11 milestone Jun 10, 2026
@swissspidy
swissspidy merged commit 4730c6d into main Jun 10, 2026
151 of 152 checks passed
@swissspidy
swissspidy deleted the fix/normalize-line-endings branch June 10, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

os:windows scope:testing Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants