исправлен падающий тест#1689
Conversation
📝 WalkthroughWalkthroughA single test assertion in ChangesCross-platform line ending normalization in XML doc test
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/Tests/DocumenterTests/XmlDocConversionTest.cs (1)
30-30: ⚡ Quick winAccept
ReplaceLineEndings—it’s available for this test target
src/Tests/DocumenterTests/XmlDocConversionTest.cs:30usesconverter.ConvertTextBlock(exampleNode).ReplaceLineEndings("\n"); the test project targetsnet8.0(viaoscommon.targets→TargetFrameworkVersion), andstring.ReplaceLineEndingsexists since .NET 6, so this is safe and not related to the C# 8 / LangVersion rule.For consistency,
PreprocessorTests.csuses.Replace("\r\n", "\n"), but theReplaceLineEndingsapproach 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
📒 Files selected for processing (1)
src/Tests/DocumenterTests/XmlDocConversionTest.cs
Исправлен единственный падающий тест.
Причина: XmlDocConverter.ConvertTextBlock использует StringBuilder.AppendLine, который, в свою очередь, использует установленный по умолчанию Environment.NewLine == "\r\n" в Windows. А в исходниках везде "\n"
Summary by CodeRabbit