From 9d684006fc4c7e5c060b2cd2968a637877b56c30 Mon Sep 17 00:00:00 2001 From: neuecc Date: Mon, 29 Jun 2020 03:02:23 +0900 Subject: [PATCH] test --- src/UniTask.NetCoreSandbox/Program.cs | 40 ++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/src/UniTask.NetCoreSandbox/Program.cs b/src/UniTask.NetCoreSandbox/Program.cs index b97f9a8..d39d822 100644 --- a/src/UniTask.NetCoreSandbox/Program.cs +++ b/src/UniTask.NetCoreSandbox/Program.cs @@ -1,4 +1,6 @@ -using Cysharp.Threading.Tasks; +#pragma warning disable CS1998 + +using Cysharp.Threading.Tasks; using System.Linq; using System; @@ -56,6 +58,24 @@ namespace NetCoreSandbox } + class Foo + { + public async UniTask MethodFooAsync() + { + await MethodBarAsync(); + } + + private async UniTask MethodBarAsync() + + { + Throw(); + } + + private void Throw() + { + throw new Exception(); + } + } public struct TestAwaiter : ICriticalNotifyCompletion { @@ -277,6 +297,24 @@ namespace NetCoreSandbox #endif // await new AllocationCheck().ViaUniTaskVoid(); + var buttonTest = new AsyncReactiveProperty(AsyncUnit.Default); + + buttonTest + .Subscribe(async _ => + { + try + { + await new Foo().MethodFooAsync(); + } + catch (Exception e) + { + Console.WriteLine(e.StackTrace); + } + }); + + buttonTest.Value = AsyncUnit.Default; + + // AsyncTest().Forge Console.WriteLine("A?");