refactor(app): close ordered startup composition

This commit is contained in:
Erik 2026-07-22 19:20:20 +02:00
parent 54244d31f1
commit 530b4bd8f5
16 changed files with 537 additions and 215 deletions

View file

@ -52,22 +52,21 @@ public sealed class GameWindowSlice8BoundaryTests
AssertAppearsInOrder(
body,
"GameWindowPlatformResult<GL, IInputContext> platform = AcquirePlatform();",
"GameWindowCompositionPipeline.Run<",
"new HostInputCameraCompositionPhase(",
"this).Compose(platform);",
"this).Compose(platformResult),",
"new ContentEffectsAudioCompositionPhase(",
"this).Compose(platform, hostInputCamera);",
"this).Compose(platformResult, hostInputCamera),",
"new SettingsDevToolsCompositionPhase(",
"this).Compose(platform, hostInputCamera, contentEffectsAudio);",
"InteractionRetainedUiResult interactionUi =",
"this).Compose(platformResult, hostInputCamera, contentEffectsAudio);",
"new InteractionRetainedUiCompositionPhase(",
"this).Compose(",
"LivePresentationResult livePresentation =",
"new LivePresentationCompositionPhase(",
"this).Compose(",
"new SessionPlayerCompositionPhase(",
"FrameRootResult frameRoots = new FrameRootCompositionPhase(",
"new FrameRootCompositionPhase(",
"new SessionStartCompositionPhase(",
".Start(frameRoots);");
".Start(frameRoots));");
string framePhase = File.ReadAllText(Path.Combine(
FindRepoRoot(),
@ -98,7 +97,7 @@ public sealed class GameWindowSlice8BoundaryTests
"_publication.PublishSessionPlayer(result);");
Assert.Equal(1, CountOccurrences(
body,
".Start(frameRoots);"));
".Start(frameRoots));"));
string phaseOne = Slice(
File.ReadAllText(Path.Combine(
FindRepoRoot(),
@ -131,9 +130,9 @@ public sealed class GameWindowSlice8BoundaryTests
"case LiveSessionStartStatus.MissingCredentials:",
"case LiveSessionStartStatus.Failed:");
int start = body.IndexOf(
".Start(frameRoots);",
".Start(frameRoots));",
StringComparison.Ordinal);
string postStart = body[(start + ".Start(frameRoots);".Length)..];
string postStart = body[(start + ".Start(frameRoots));".Length)..];
Assert.Empty(System.Text.RegularExpressions.Regex.Matches(
postStart,
@"(?m)^\s+_[A-Za-z]\w*\s*(?:\?\?=|=)"));
@ -174,7 +173,7 @@ public sealed class GameWindowSlice8BoundaryTests
source,
StringComparison.Ordinal);
Assert.Contains(
"new WorldRenderDependencies(\n _worldEnvironment,",
"new WorldRenderDependencies(\n _worldEnvironment,",
load.Replace("\r\n", "\n", StringComparison.Ordinal),
StringComparison.Ordinal);
string worldCompose = Slice(
@ -350,13 +349,14 @@ public sealed class GameWindowSlice8BoundaryTests
"Window.Create(options)");
AssertAppearsInOrder(
load,
"GameWindowCompositionPipeline.Run<",
"new SettingsDevToolsCompositionPhase(",
"this).Compose(platform, hostInputCamera, contentEffectsAudio);",
"this).Compose(platformResult, hostInputCamera, contentEffectsAudio);",
"new WorldRenderCompositionPhase(",
"new SessionPlayerCompositionPhase(",
"new FrameRootCompositionPhase(",
"new SessionStartCompositionPhase(",
".Start(frameRoots);");
".Start(frameRoots));");
string sessionPhase = File.ReadAllText(Path.Combine(
FindRepoRoot(),
"src",