Skip to content

Commit

Permalink
Test without cancellation token.
Browse files Browse the repository at this point in the history
  • Loading branch information
SvenGroot committed Nov 29, 2023
1 parent bd6facc commit f425aaa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Ookii.CommandLine.Tests/CommandTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public int Run()
public async Task<int> RunAsync(CancellationToken cancellationToken)
{
await Task.Delay(Value, cancellationToken);
return 0;
return 10;
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/Ookii.CommandLine.Tests/SubCommandTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ public async Task TestAsyncCancelableCommand(ProviderKind kind)
var manager = CreateManager(kind);
await Assert.ThrowsExceptionAsync<TaskCanceledException>(
async () => await manager.RunCommandAsync(["AsyncCancelableCommand", "10000"], source.Token));

// Command works if not passed a token.
Assert.AreEqual(10, await manager.RunCommandAsync(["AsyncCancelableCommand", "10"]));
}


Expand Down

0 comments on commit f425aaa

Please sign in to comment.