Normalize source line endings in regression assertions

This commit is contained in:
nick 2026-11-21 10:27:21 +00:00
parent e719277fc9
commit 33e3a564b8

View File

@ -1031,7 +1031,7 @@ static void StoryIntelligenceReviewCentreRouteReplacesLinearReviewResume()
{
var root = PlotLineRoot();
var controller = File.ReadAllText(Path.Combine(root, "Controllers/OnboardingController.cs"));
var service = File.ReadAllText(Path.Combine(root, "Services/OnboardingStoryIntelligenceService.cs"));
var service = File.ReadAllText(Path.Combine(root, "Services/OnboardingStoryIntelligenceService.cs")).ReplaceLineEndings("\n");
var view = File.ReadAllText(Path.Combine(root, "Views/Onboarding/StoryIntelligenceReviewCentre.cshtml"));
Assert(controller.Contains("story-intelligence/review-centre", StringComparison.Ordinal), "Review Centre route should exist.");
@ -1078,7 +1078,7 @@ static void StoryIntelligenceReviewCentreUsesIndependentTileGrid()
{
var root = PlotLineRoot();
var centre = File.ReadAllText(Path.Combine(root, "Views/Onboarding/StoryIntelligenceReviewCentre.cshtml"));
var css = File.ReadAllText(Path.Combine(root, "wwwroot/css/onboarding.css"));
var css = File.ReadAllText(Path.Combine(root, "wwwroot/css/onboarding.css")).ReplaceLineEndings("\n");
var tileOrder = new[]
{
"\"Characters\"",
@ -1680,7 +1680,7 @@ static void StoryIntelligenceDetailedReviewGetsUseSelectedModulePaths()
static void StoryIntelligenceCompletedCharacterReviewRemainsInspectable()
{
var root = PlotLineRoot();
var controller = File.ReadAllText(Path.Combine(root, "Controllers/OnboardingController.cs"));
var controller = File.ReadAllText(Path.Combine(root, "Controllers/OnboardingController.cs")).ReplaceLineEndings("\n");
var onboarding = File.ReadAllText(Path.Combine(root, "Services/OnboardingStoryIntelligenceService.cs"));
var candidateService = File.ReadAllText(Path.Combine(root, "Services/StoryIntelligenceReviewCandidateService.cs"));
var view = File.ReadAllText(Path.Combine(root, "Views/Onboarding/StoryIntelligenceCharacters.cshtml"));
@ -2302,7 +2302,7 @@ static void WordCompanionCanonicalMarkersDriveRuntimeFollow()
static void WordCompanionRuntimeFollowsMultipleImportedSceneAnchors()
{
var root = Path.Combine(AppContext.BaseDirectory, "../../../../PlotLine");
var script = File.ReadAllText(Path.Combine(root, "wwwroot/js/word-companion-host.js"));
var script = File.ReadAllText(Path.Combine(root, "wwwroot/js/word-companion-host.js")).ReplaceLineEndings("\n");
Assert(script.Contains("await loadParagraphAnchors(context, bodyParagraphs, null, \"runtime structure\")", StringComparison.Ordinal), "Runtime structure reads must load paragraph anchors, not only text/style.");
Assert(script.Contains("chapterAnchorId: paragraphAnchorId(paragraph, \"PD-CHAPTER\")", StringComparison.Ordinal), "Runtime paragraph snapshots should carry canonical chapter anchors.");
@ -2432,7 +2432,7 @@ static void WritingPagesDoNotRequireStoryIntelligence()
static void WordCompanionHostScriptHasValidTabMapping()
{
var root = Path.Combine(AppContext.BaseDirectory, "../../../../PlotLine");
var script = File.ReadAllText(Path.Combine(root, "wwwroot/js/word-companion-host.js"));
var script = File.ReadAllText(Path.Combine(root, "wwwroot/js/word-companion-host.js")).ReplaceLineEndings("\n");
var view = File.ReadAllText(Path.Combine(root, "Views/WordCompanionHost/Index.cshtml"));
Assert(script.Contains("const normalizeTabName = (tabName) =>", StringComparison.Ordinal), "Tab-name compatibility helper is missing.");
@ -3237,7 +3237,7 @@ static void LocationCandidateIdentityIsParentAwareForGenericSubLocations()
static void LocationsPageUsesHierarchicalSortOrder()
{
var root = Path.Combine(AppContext.BaseDirectory, "../../../../PlotLine");
var service = File.ReadAllText(Path.Combine(root, "Services/CoreServices.cs"));
var service = File.ReadAllText(Path.Combine(root, "Services/CoreServices.cs")).ReplaceLineEndings("\n");
var index = File.ReadAllText(Path.Combine(root, "Views/Locations/Index.cshtml"));
Assert(index.Contains("<partial name=\"_LocationTree\" model=\"Model\"", StringComparison.Ordinal), "Locations page and AJAX updates should share the location tree.");
var view = File.ReadAllText(Path.Combine(root, "Views/Locations/_LocationTree.cshtml"));
@ -4424,7 +4424,7 @@ static void StructuralImportCreatesScenesBeforeWordSync()
static void StructuralImportCreatesFirstSceneWithoutPlaceholder()
{
var root = Path.Combine(AppContext.BaseDirectory, "../../../../PlotLine");
var migration = File.ReadAllText(Path.Combine(root, "Sql/157_Phase25B_OnboardingBuildFirstSceneInsert.sql"));
var migration = File.ReadAllText(Path.Combine(root, "Sql/157_Phase25B_OnboardingBuildFirstSceneInsert.sql")).ReplaceLineEndings("\n");
Assert(migration.Contains("CREATE OR ALTER PROCEDURE dbo.Onboarding_ManuscriptBuild_Create", StringComparison.Ordinal), "Forward migration should update the onboarding build stored procedure.");
Assert(migration.Contains("IF @SceneID IS NOT NULL", StringComparison.Ordinal), "First scene handling should only update an existing placeholder when one exists.");
@ -4768,7 +4768,7 @@ static void CoreImportWizardOrdersScenesBeforeCharacters()
var controller = File.ReadAllText(Path.Combine(root, "Controllers/OnboardingController.cs"));
var review = File.ReadAllText(Path.Combine(root, "Views/Onboarding/ScanReview.cshtml"));
var complete = File.ReadAllText(Path.Combine(root, "Views/Onboarding/BuildComplete.cshtml"));
var onboarding = File.ReadAllText(Path.Combine(root, "Services/OnboardingService.cs"));
var onboarding = File.ReadAllText(Path.Combine(root, "Services/OnboardingService.cs")).ReplaceLineEndings("\n");
Assert(review.Contains("value=\"structure\"", StringComparison.Ordinal), "Chapter review should submit to structural import, not character review.");
Assert(review.Contains("Continue to Scene Detection", StringComparison.Ordinal), "Chapter review should move to scene detection with clear wording.");
@ -4834,7 +4834,7 @@ static void StoryIntelligenceUsesPersistedSceneSourceAfterRestart()
static void StoryIntelligenceCanonicalModeBypassesDuplicateBoundaryAnalysis()
{
var root = Path.Combine(AppContext.BaseDirectory, "../../../../PlotLine");
var runner = File.ReadAllText(Path.Combine(root, "Services/PersistedStoryIntelligenceRunner.cs"));
var runner = File.ReadAllText(Path.Combine(root, "Services/PersistedStoryIntelligenceRunner.cs")).ReplaceLineEndings("\n");
var repository = File.ReadAllText(Path.Combine(root, "Data/OnboardingBuildRepository.cs"));
var progressView = File.ReadAllText(Path.Combine(root, "Views/Onboarding/StoryIntelligenceProgress.cshtml"));
var progressJs = File.ReadAllText(Path.Combine(root, "wwwroot/js/story-intelligence-progress.js"));
@ -5580,7 +5580,7 @@ static void CoreImportReviewChaptersIsCompactAndChapterOnly()
static void CoreImportDetectScenesIsCompactAndOwnsTitleOption()
{
var root = Path.Combine(AppContext.BaseDirectory, "../../../../PlotLine");
var index = File.ReadAllText(Path.Combine(root, "Views/Onboarding/Index.cshtml"));
var index = File.ReadAllText(Path.Combine(root, "Views/Onboarding/Index.cshtml")).ReplaceLineEndings("\n");
var script = File.ReadAllText(Path.Combine(root, "wwwroot/js/word-companion-presence.js"));
var analyzer = File.ReadAllText(Path.Combine(root, "Services/ManuscriptStructureAnalysisService.cs"));
var detectScenesBlock = Between(index, "@if (structureReadyToImport)", "else\n {");
@ -5636,7 +5636,7 @@ static void StoryIntelligenceStartsFromCoreImportComplete()
{
var root = Path.Combine(AppContext.BaseDirectory, "../../../../PlotLine");
var complete = File.ReadAllText(Path.Combine(root, "Views/Onboarding/BuildComplete.cshtml"));
var controller = File.ReadAllText(Path.Combine(root, "Controllers/OnboardingController.cs"));
var controller = File.ReadAllText(Path.Combine(root, "Controllers/OnboardingController.cs")).ReplaceLineEndings("\n");
var service = File.ReadAllText(Path.Combine(root, "Services/OnboardingStoryIntelligenceService.cs"));
Assert(complete.Contains("asp-action=\"StoryIntelligencePlotContext\"", StringComparison.Ordinal), "Core Import Complete should open the optional author Plot Line context screen before analysis.");
@ -8139,7 +8139,7 @@ static void StoryIntelligenceNarrativeStageFollowsKnowledge()
var root = Path.Combine(AppContext.BaseDirectory, "../../../../PlotLine");
var stages = File.ReadAllText(Path.Combine(root, "Models/StoryIntelligencePersistenceModels.cs"));
var pipeline = File.ReadAllText(Path.Combine(root, "Services/StoryIntelligencePipelineStateService.cs"));
var onboarding = File.ReadAllText(Path.Combine(root, "Services/OnboardingStoryIntelligenceService.cs"));
var onboarding = File.ReadAllText(Path.Combine(root, "Services/OnboardingStoryIntelligenceService.cs")).ReplaceLineEndings("\n");
var controller = File.ReadAllText(Path.Combine(root, "Controllers/OnboardingController.cs"));
var pipelineConstraint = File.ReadAllText(Path.Combine(root, "Sql/156_Phase25A_NarrativeReviewPipelineConstraint.sql"));
var knowledgeImport = File.ReadAllText(Path.Combine(root, "Services/StoryIntelligenceKnowledgeImportService.cs"));