Skip to content

исправлен падающий тест#1689

Merged
EvilBeaver merged 1 commit into
EvilBeaver:developfrom
Mr-Rm:fix-doctest
May 27, 2026
Merged

исправлен падающий тест#1689
EvilBeaver merged 1 commit into
EvilBeaver:developfrom
Mr-Rm:fix-doctest

Conversation

@Mr-Rm
Copy link
Copy Markdown
Collaborator

@Mr-Rm Mr-Rm commented May 27, 2026

Исправлен единственный падающий тест.
Причина: XmlDocConverter.ConvertTextBlock использует StringBuilder.AppendLine, который, в свою очередь, использует установленный по умолчанию Environment.NewLine == "\r\n" в Windows. А в исходниках везде "\n"

Summary by CodeRabbit

  • Tests
    • Enhanced test reliability for XML documentation conversion to ensure consistent behavior across different operating systems.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 27, 2026

📝 Walkthrough

Walkthrough

A single test assertion in XmlDocConversionTest is updated to normalize platform-specific line endings to \n before comparing the converted XML output against expected multiline text.

Changes

Cross-platform line ending normalization in XML doc test

Layer / File(s) Summary
Line ending normalization in test assertion
src/Tests/DocumenterTests/XmlDocConversionTest.cs
TestConversionOfTextBlock assertion now normalizes the converted XML text block's line endings to Unix format using ReplaceLineEndings("\n") before comparison with the expected string.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A line break mended, cross-platform befriended,
Unix and Windows can now both agree,
Where \n unites what once split in three,
The test runs smooth, from shore to sea!
🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title in Russian translates to 'fixed falling test' which accurately describes the main change - fixing a failing test in XmlDocConversionTest by normalizing line endings.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/Tests/DocumenterTests/XmlDocConversionTest.cs (1)

30-30: ⚡ Quick win

Accept ReplaceLineEndings—it’s available for this test target
src/Tests/DocumenterTests/XmlDocConversionTest.cs:30 uses converter.ConvertTextBlock(exampleNode).ReplaceLineEndings("\n"); the test project targets net8.0 (via oscommon.targetsTargetFrameworkVersion), and string.ReplaceLineEndings exists since .NET 6, so this is safe and not related to the C# 8 / LangVersion rule.

For consistency, PreprocessorTests.cs uses .Replace("\r\n", "\n"), but the ReplaceLineEndings approach is fine.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/Tests/DocumenterTests/XmlDocConversionTest.cs` at line 30, The test
currently calls
converter.ConvertTextBlock(exampleNode).ReplaceLineEndings("\n"); keep this
as-is (do not change it to a manual Replace("\r\n", "\n")) because the test
project targets net8.0 and string.ReplaceLineEndings is available; ensure no
LangVersion or C#8-related changes are applied and leave the ConvertTextBlock
call unchanged in XmlDocConversionTest.ConvertTextBlock usage.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/Tests/DocumenterTests/XmlDocConversionTest.cs`:
- Line 30: The test currently calls
converter.ConvertTextBlock(exampleNode).ReplaceLineEndings("\n"); keep this
as-is (do not change it to a manual Replace("\r\n", "\n")) because the test
project targets net8.0 and string.ReplaceLineEndings is available; ensure no
LangVersion or C#8-related changes are applied and leave the ConvertTextBlock
call unchanged in XmlDocConversionTest.ConvertTextBlock usage.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 63b013eb-e44b-4421-8ca1-b6ba3b11423a

📥 Commits

Reviewing files that changed from the base of the PR and between e089086 and 7cb7250.

📒 Files selected for processing (1)
  • src/Tests/DocumenterTests/XmlDocConversionTest.cs

@EvilBeaver EvilBeaver merged commit c0c999a into EvilBeaver:develop May 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants