You've already forked linux-packaging-mono
Imported Upstream version 5.8.0.22
Former-commit-id: df344e34b07851d296efb3e6604c8db42b6f7aa3
This commit is contained in:
parent
5f4a27cc8a
commit
7d05485754
53
mcs/tests/test-tuple-01.cs
Normal file
53
mcs/tests/test-tuple-01.cs
Normal file
@ -0,0 +1,53 @@
|
||||
using System;
|
||||
|
||||
static class X
|
||||
{
|
||||
static (int, string) Test1 ()
|
||||
{
|
||||
return ValueTuple.Create (1, "2");
|
||||
}
|
||||
|
||||
static void Test2 ((int Item1, int Item2) arg)
|
||||
{
|
||||
}
|
||||
|
||||
static void Test3 ((int a, string b) arg)
|
||||
{
|
||||
}
|
||||
|
||||
static (int a, string b) Test4 ()
|
||||
{
|
||||
return ValueTuple.Create (1, "x");
|
||||
}
|
||||
|
||||
static int Main ()
|
||||
{
|
||||
var res = Test1 ();
|
||||
if (res.Item1 != 1) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (res.Item2 != "2") {
|
||||
return 2;
|
||||
}
|
||||
|
||||
ValueTuple<int, string> res2 = res;
|
||||
|
||||
Test3 (ValueTuple.Create (1, "2"));
|
||||
|
||||
var res3 = Test4 ();
|
||||
if (res3.Item1 != 1)
|
||||
return 3;
|
||||
|
||||
if (res3.a != 1)
|
||||
return 4;
|
||||
|
||||
if (res3.Item2 != "x")
|
||||
return 5;
|
||||
|
||||
if (res3.b != "x")
|
||||
return 6;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user