Take stars out of types where they make more sense.
[mono-project.git] / mcs / tests / test-async-12.cs
blob3876c8a1e7d3a74f4aeada5dc6804a0e4edefa99
1 using System;
2 using System.Threading.Tasks;
3 using System.Threading;
5 class C
7 static async Task<int> TestNested_1 ()
9 return Call (
10 await Task.Factory.StartNew (() => { Thread.Sleep (10); return 5; }).ConfigureAwait (false),
11 await Task.Factory.StartNew (() => -3).ConfigureAwait (false),
12 await Task.Factory.StartNew (() => 6).ConfigureAwait (false));
15 static int Call (int arg1, int arg2, int arg3)
17 if (arg1 != 5)
18 return 1;
20 if (arg2 != -3)
21 return 2;
23 if (arg3 != 6)
24 return 3;
26 return 0;
29 public static int Main ()
31 var t1 = TestNested_1 ();
32 if (!Task.WaitAll (new[] { t1 }, 1000))
33 return 1;
35 if (t1.Result != 0)
36 return 2;
38 Console.WriteLine ("ok");
39 return 0;