Skip to content

Commit d67c5a1

Browse files
authored
Add Android functional test for invariant culture only mode (#49204)
Contributes to #43865 ./build.sh mono+libs -os Android -arch x64 -c Release ./dotnet.sh build /t:Test src/tests/FunctionalTests/Android/Device_Emulator/InvariantCultureOnlyMode /p:TargetOS=Android /p:TargetArchitecture=x64 /p:Configuration=Release
1 parent 689bac6 commit d67c5a1

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<OutputType>Exe</OutputType>
4+
<MonoForceInterpreter>true</MonoForceInterpreter>
5+
<RunAOTCompilation>false</RunAOTCompilation>
6+
<InvariantGlobalization>true</InvariantGlobalization>
7+
<TestRuntime>true</TestRuntime>
8+
<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
9+
<MainLibraryFileName>Android.Device_Emulator.InvariantCultureOnlyMode.Test.dll</MainLibraryFileName>
10+
<IncludesTestRunner>false</IncludesTestRunner>
11+
<ExpectedExitCode>42</ExpectedExitCode>
12+
</PropertyGroup>
13+
14+
<ItemGroup>
15+
<Compile Include="Program.cs" />
16+
</ItemGroup>
17+
</Project>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using System;
5+
using System.Globalization;
6+
7+
public static class Program
8+
{
9+
public static int Main(string[] args)
10+
{
11+
var culture = new CultureInfo("es-ES", false);
12+
// https://github.com/dotnet/runtime/blob/main/docs/design/features/globalization-invariant-mode.md#cultures-and-culture-data
13+
int result = culture.LCID == 0x1000 && culture.NativeName == "Invariant Language (Invariant Country)" ? 42 : 1;
14+
15+
return result;
16+
}
17+
}

0 commit comments

Comments
 (0)