Merge pull request #5675 from mono/glib-debug-symbols
[mono.git] / mcs / tests / test-async-56.cs
1 using System;
2 using System.Threading;
3 using System.Threading.Tasks;
4
5 class Test
6 {
7         public static int Main ()
8         {
9                 Task<int> t = TestMethod ();
10
11                 try {
12                         t.Start ();
13                         return 1;
14                 } catch (InvalidOperationException) {
15                 }
16
17                 try {
18                         t.RunSynchronously ();
19                         return 2;
20                 } catch (InvalidOperationException) {
21                 }
22
23                 Console.WriteLine ("ok");
24                 return 0;
25         }
26
27         async static Task<int> TestMethod ()
28         {
29                 await Task.Delay (100000);
30                 return 1;
31         }
32 }