You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
71
mcs/tests/test-async-86.cs
Normal file
71
mcs/tests/test-async-86.cs
Normal file
@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public class Program
|
||||
{
|
||||
string Data {
|
||||
get {
|
||||
return data;
|
||||
}
|
||||
set {
|
||||
++setter_called;
|
||||
data = value;
|
||||
}
|
||||
}
|
||||
|
||||
int setter_called;
|
||||
string data = "init-";
|
||||
|
||||
string this [string arg] {
|
||||
get {
|
||||
return i_data;
|
||||
}
|
||||
set {
|
||||
++i_setter_called;
|
||||
i_data = value;
|
||||
}
|
||||
}
|
||||
|
||||
int i_setter_called;
|
||||
string i_data = "init2-";
|
||||
|
||||
public static int Main()
|
||||
{
|
||||
var p = new Program ();
|
||||
p.TestProperty ().Wait ();
|
||||
if (p.data != "init-nxa123z") {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (p.setter_called != 1)
|
||||
return 2;
|
||||
|
||||
p.TestIndexer ().Wait ();
|
||||
|
||||
if (p.i_data != "init2-nxa123z") {
|
||||
return 3;
|
||||
}
|
||||
|
||||
if (p.i_setter_called != 1)
|
||||
return 4;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
async Task TestProperty ()
|
||||
{
|
||||
Data += "n" + await StringValue () + "a" + 123.ToString () + "z";
|
||||
}
|
||||
|
||||
async Task TestIndexer ()
|
||||
{
|
||||
string arg = "foo";
|
||||
this[arg] += "n" + await StringValue () + "a" + 123.ToString () + "z";
|
||||
}
|
||||
|
||||
async Task<string> StringValue ()
|
||||
{
|
||||
await Task.Yield ();
|
||||
return "x";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user