From d6a09073b56fc46838ce01065744bc8b3c590925 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Fri, 21 Aug 2026 21:26:18 +1000 Subject: [PATCH] Exercise the sync launch from the sync named tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LaunchAndKill and LaunchAndKillAsync were byte identical, and both awaited LaunchAsync. So were LaunchAndKillDisabled and its Async twin, and the two MaxInstancesToLaunch cases. The synchronous DiffRunner.Launch had no coverage at all while the suite carried four tests whose names said it did. Point the non-Async half at DiffRunner.Launch. Worth having on its own terms: the two overloads do not resolve the tool the same way — Launch asks TryFindByExtension and LaunchAsync asks TryFindForInputFilePath — so a pair of tests that only ever calls one of them cannot see the two drift apart. --- src/DiffEngine.Tests/DiffRunnerTests.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/DiffEngine.Tests/DiffRunnerTests.cs b/src/DiffEngine.Tests/DiffRunnerTests.cs index ed9acacf..f4b4087b 100644 --- a/src/DiffEngine.Tests/DiffRunnerTests.cs +++ b/src/DiffEngine.Tests/DiffRunnerTests.cs @@ -43,11 +43,11 @@ public async Task MaxInstancesToLaunch() { await Task.Delay(500); ProcessCleanup.Refresh(); - var result = await DiffRunner.LaunchAsync(file1, "fake.txt"); + var result = DiffRunner.Launch(file1, "fake.txt"); await Task.Delay(300); await Assert.That(result).IsEqualTo(LaunchResult.StartedNewInstance); ProcessCleanup.Refresh(); - result = await DiffRunner.LaunchAsync(file2, "fake.txt"); + result = DiffRunner.Launch(file2, "fake.txt"); await Assert.That(result).IsEqualTo(LaunchResult.TooManyRunningDiffTools); ProcessCleanup.Refresh(); DiffRunner.Kill(file1, "fake.txt"); @@ -119,7 +119,7 @@ public async Task LaunchAndKillDisabled() await WaitForRunning(false); await Assert.That(IsRunning()).IsFalse(); await Assert.That(ProcessCleanup.IsRunning(command)).IsFalse(); - var result = await DiffRunner.LaunchAsync(file1, file2); + var result = DiffRunner.Launch(file1, file2); await Assert.That(result).IsEqualTo(LaunchResult.Disabled); Thread.Sleep(500); ProcessCleanup.Refresh(); @@ -170,7 +170,7 @@ public async Task LaunchAndKill() await WaitForRunning(false); await Assert.That(IsRunning()).IsFalse(); await Assert.That(ProcessCleanup.IsRunning(command)).IsFalse(); - var result = await DiffRunner.LaunchAsync(file1, file2); + var result = DiffRunner.Launch(file1, file2); await Assert.That(result).IsEqualTo(LaunchResult.StartedNewInstance); await WaitForRunning(true); await Assert.That(IsRunning()).IsTrue();