diff --git a/src/Ookii.CommandLine.Tests/CommandTypes.cs b/src/Ookii.CommandLine.Tests/CommandTypes.cs index fa1f14d..80e33d1 100644 --- a/src/Ookii.CommandLine.Tests/CommandTypes.cs +++ b/src/Ookii.CommandLine.Tests/CommandTypes.cs @@ -115,7 +115,7 @@ public int Run() public async Task RunAsync(CancellationToken cancellationToken) { await Task.Delay(Value, cancellationToken); - return 0; + return 10; } } diff --git a/src/Ookii.CommandLine.Tests/SubCommandTest.cs b/src/Ookii.CommandLine.Tests/SubCommandTest.cs index 2185c71..6de3875 100644 --- a/src/Ookii.CommandLine.Tests/SubCommandTest.cs +++ b/src/Ookii.CommandLine.Tests/SubCommandTest.cs @@ -353,6 +353,9 @@ public async Task TestAsyncCancelableCommand(ProviderKind kind) var manager = CreateManager(kind); await Assert.ThrowsExceptionAsync( async () => await manager.RunCommandAsync(["AsyncCancelableCommand", "10000"], source.Token)); + + // Command works if not passed a token. + Assert.AreEqual(10, await manager.RunCommandAsync(["AsyncCancelableCommand", "10"])); }