diff options
Diffstat (limited to 'src/libraries/System.Runtime.Loader/tests/ApplyUpdate')
5 files changed, 91 insertions, 0 deletions
diff --git a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression/StaticLambdaRegression.cs b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression/StaticLambdaRegression.cs new file mode 100644 index 00000000000..d98c367138b --- /dev/null +++ b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression/StaticLambdaRegression.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +using System; + + +namespace System.Reflection.Metadata.ApplyUpdate.Test; + +public class StaticLambdaRegression +{ + public int count; + + public string TestMethod() + { + count++; +#if false + Message (static () => "hello"); +#endif + return count.ToString(); + } + +#if false + public void Message (Func<string> msg) => Console.WriteLine (msg()); +#endif +} diff --git a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression/StaticLambdaRegression_v1.cs b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression/StaticLambdaRegression_v1.cs new file mode 100644 index 00000000000..50194feb249 --- /dev/null +++ b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression/StaticLambdaRegression_v1.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +using System; + + +namespace System.Reflection.Metadata.ApplyUpdate.Test; + +public class StaticLambdaRegression +{ + public int count; + + public string TestMethod() + { + count++; +#if true + Message (static () => "hello2"); +#endif + return count.ToString(); + } + +#if true + public void Message (Func<string> msg) => Console.WriteLine (msg()); +#endif +} diff --git a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression/StaticLambdaRegression_v2.cs b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression/StaticLambdaRegression_v2.cs new file mode 100644 index 00000000000..bde43c311c4 --- /dev/null +++ b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression/StaticLambdaRegression_v2.cs @@ -0,0 +1,25 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +using System; + + +namespace System.Reflection.Metadata.ApplyUpdate.Test; + +public class StaticLambdaRegression +{ + public int count; + + public string TestMethod() + { + count++; +#if true + Message (static () => "hello2"); +#endif + Message (static () => "goodbye"); + return count.ToString(); + } + +#if true + public void Message (Func<string> msg) => Console.WriteLine (msg()); +#endif +} diff --git a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression/System.Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression.csproj b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression/System.Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression.csproj new file mode 100644 index 00000000000..015a252a700 --- /dev/null +++ b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression/System.Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression.csproj @@ -0,0 +1,11 @@ +<Project Sdk="Microsoft.NET.Sdk"> + <PropertyGroup> + <RootNamespace>System.Runtime.Loader.Tests</RootNamespace> + <TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks> + <TestRuntime>true</TestRuntime> + <DeltaScript>deltascript.json</DeltaScript> + </PropertyGroup> + <ItemGroup> + <Compile Include="StaticLambdaRegression.cs" /> + </ItemGroup> +</Project> diff --git a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression/deltascript.json b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression/deltascript.json new file mode 100644 index 00000000000..f8ece3182bc --- /dev/null +++ b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression/deltascript.json @@ -0,0 +1,7 @@ +{ + "changes": [ + {"document": "StaticLambdaRegression.cs", "update": "StaticLambdaRegression_v1.cs"}, + {"document": "StaticLambdaRegression.cs", "update": "StaticLambdaRegression_v2.cs"}, + ] +} + |