Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs/tools
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2019-08-08 12:06:53 +0300
committerMarek Safar <marek.safar@gmail.com>2019-08-08 20:10:03 +0300
commit2ef50f54eee453a87b26cc49ad4dc1b89ab7aa46 (patch)
tree85c564fb23b25b646720e0f634e7d5648717dc73 /mcs/tools
parentb15518dd5e487cccf98815d9831d0a4b681269fc (diff)
Bump corefx for #15259 fix
Diffstat (limited to 'mcs/tools')
-rw-r--r--mcs/tools/linker/Makefile5
-rw-r--r--mcs/tools/linker/Tests/System.Core/test-queryable-01.cs31
-rw-r--r--mcs/tools/linker/Tests/System.Core/test-queryable-02.cs20
3 files changed, 43 insertions, 13 deletions
diff --git a/mcs/tools/linker/Makefile b/mcs/tools/linker/Makefile
index 9564a1d4d40..09d805fd557 100644
--- a/mcs/tools/linker/Makefile
+++ b/mcs/tools/linker/Makefile
@@ -27,7 +27,6 @@ TEST_CASES := \
ifdef INCLUDE_DISABLED
TEST_CASES += \
- System.Core/test-queryable-01.cs \
System.Runtime.Serialization/test-dcs-01.cs \
mscorlib/test-marshaling.cs
endif
@@ -41,7 +40,9 @@ endif
ifndef AOT_FRIENDLY_PROFILE
TEST_CASES += \
mscorlib/test-remoting.cs \
- mscorlib/test-reflection.cs
+ mscorlib/test-reflection.cs \
+ System.Core/test-queryable-01.cs \
+ System.Core/test-queryable-02.cs
endif
TESTS_COMPILER = $(MCS) -nologo -noconfig -unsafe -nostdlib -debug:portable -r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/mscorlib.dll
diff --git a/mcs/tools/linker/Tests/System.Core/test-queryable-01.cs b/mcs/tools/linker/Tests/System.Core/test-queryable-01.cs
index ef36f2d1ead..00b4adc37e2 100644
--- a/mcs/tools/linker/Tests/System.Core/test-queryable-01.cs
+++ b/mcs/tools/linker/Tests/System.Core/test-queryable-01.cs
@@ -1,21 +1,30 @@
using System;
-using System.Linq.Expressions;
+using System.Runtime.InteropServices;
using System.Linq;
-public class QueryableUsedViaExpression {
+public class TestQueryableOrderBy
+{
public static void Main ()
{
- var q = "Test".AsQueryable ();
- var count = CallQueryableCount (q);
- q.Count ();
- //Console.WriteLine ($"count: {count}");
+ Test ();
}
- public static int CallQueryableCount (IQueryable source)
+ class Pet
{
- return source.Provider.Execute<int> (
- Expression.Call (
- typeof (Queryable), "Count",
- new Type [] { source.ElementType }, source.Expression));
+ public string Name { get; set; }
+ public int Age { get; set; }
+ }
+
+ static void Test ()
+ {
+ Pet[] pets = { new Pet { Name="Barley", Age=8 },
+ new Pet { Name="Boots", Age=4 },
+ new Pet { Name="Whiskers", Age=1 }
+ };
+
+ var query = pets.AsQueryable ().OrderByDescending (pet => pet.Age);
+
+ foreach (Pet pet in query)
+ Console.WriteLine("{0} - {1}", pet.Name, pet.Age);
}
}
diff --git a/mcs/tools/linker/Tests/System.Core/test-queryable-02.cs b/mcs/tools/linker/Tests/System.Core/test-queryable-02.cs
new file mode 100644
index 00000000000..21888af57f4
--- /dev/null
+++ b/mcs/tools/linker/Tests/System.Core/test-queryable-02.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Linq.Expressions;
+using System.Linq;
+
+public class QueryableUsedViaExpression {
+ public static void Main ()
+ {
+ var q = "Test".AsQueryable ();
+ var count = CallQueryableCount (q);
+ Console.WriteLine ($"count: {count}");
+ }
+
+ public static int CallQueryableCount (IQueryable source)
+ {
+ return source.Provider.Execute<int> (
+ Expression.Call (
+ typeof (Queryable), "Count",
+ new Type [] { source.ElementType }, source.Expression));
+ }
+} \ No newline at end of file