mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-02 01:03:29 +01:00
Add tests for #1084
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Terminal.Gui;
|
||||
using Xunit;
|
||||
|
||||
@@ -220,5 +222,30 @@ namespace Terminal.Gui {
|
||||
Application.Shutdown ();
|
||||
Assert.Equal (3, count);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Shutdown_Allows_Async ()
|
||||
{
|
||||
static async Task TaskWithAsyncContinuation ()
|
||||
{
|
||||
await Task.Yield ();
|
||||
await Task.Yield ();
|
||||
}
|
||||
|
||||
Init ();
|
||||
Application.Shutdown ();
|
||||
|
||||
var task = TaskWithAsyncContinuation ();
|
||||
Thread.Sleep (20);
|
||||
Assert.True (task.IsCompletedSuccessfully);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Shutdown_Resets_SyncContext ()
|
||||
{
|
||||
Init ();
|
||||
Application.Shutdown ();
|
||||
Assert.Null (SynchronizationContext.Current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user