Fix Test-MtConnection formatting tests on Windows#1984
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughUpdated connection status test regexes to accept optional carriage returns before line endings across complete, filtered, all-service, and Exchange Online Protection status assertions. ChangesConnection status test compatibility
Estimated code review effort: 1 (Trivial) | ~3 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
Summary
Test-MtConnectionformatting assertions accept both LF and CRLF line endingsRoot cause
Out-Stringuses CRLF on Windows. In multiline .NET regular expressions,$matches before\nbut not before the preceding\r, so assertions ending inNot connected$failed only on Windows.Validation
powershell/tests/pester.ps1 -TestGeneral:$false -TestFunctions:$true -Include Test-MtConnection.Tests.ps1 -Output Detailed— 35 passed, 0 failedInvoke-ScriptAnalyzerwith error severitygit diff --checkSummary by CodeRabbit