Regression test for #49826 (#49870)
authorTomáš Rylek <trylek@microsoft.com>
Fri, 19 Mar 2021 18:32:36 +0000 (11:32 -0700)
committerGitHub <noreply@github.com>
Fri, 19 Mar 2021 18:32:36 +0000 (19:32 +0100)
This can only be merged in after #49854 fixing the bug is merged in.

Thanks

Tomas

src/tests/Regressions/coreclr/GitHub_49826/test49826.cs [new file with mode: 0644]
src/tests/Regressions/coreclr/GitHub_49826/test49826.csproj [new file with mode: 0644]

diff --git a/src/tests/Regressions/coreclr/GitHub_49826/test49826.cs b/src/tests/Regressions/coreclr/GitHub_49826/test49826.cs
new file mode 100644 (file)
index 0000000..f897065
--- /dev/null
@@ -0,0 +1,18 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System;
+using System.Collections.Generic;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+
+class Program
+{
+    static int Main()
+    {
+        JsonSerializerOptions options = new JsonSerializerOptions();
+        JsonConverter converter = options.GetConverter(typeof(DateTime));
+        Console.WriteLine("Converter type: {0}", converter.GetType());
+        return converter != null ? 100 : 1;
+    }
+}
diff --git a/src/tests/Regressions/coreclr/GitHub_49826/test49826.csproj b/src/tests/Regressions/coreclr/GitHub_49826/test49826.csproj
new file mode 100644 (file)
index 0000000..944321e
--- /dev/null
@@ -0,0 +1,15 @@
+<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <CLRTestKind>BuildAndRun</CLRTestKind>
+    <CLRTestPriority>1</CLRTestPriority>
+    <Nullable>enable</Nullable>
+    <LangVersion>9.0</LangVersion>
+
+    <!-- This is an explicit crossgen test -->
+    <AlwaysUseCrossGen2>true</AlwaysUseCrossGen2>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="*.cs" />
+  </ItemGroup>
+</Project>