You've already forked linux-packaging-mono
Imported Upstream version 5.16.0.100
Former-commit-id: 38faa55fb9669e35e7d8448b15c25dc447f25767
This commit is contained in:
parent
0a9828183b
commit
7d7f676260
@@ -36,10 +36,10 @@ Global
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{484C92C6-6D2C-45BC-A5E2-4A12BA228E1E}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
|
||||
{484C92C6-6D2C-45BC-A5E2-4A12BA228E1E}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
|
||||
{484C92C6-6D2C-45BC-A5E2-4A12BA228E1E}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
|
||||
{484C92C6-6D2C-45BC-A5E2-4A12BA228E1E}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
|
||||
{484C92C6-6D2C-45BC-A5E2-4A12BA228E1E}.Debug|Any CPU.ActiveCfg = netcoreapp-Debug|Any CPU
|
||||
{484C92C6-6D2C-45BC-A5E2-4A12BA228E1E}.Debug|Any CPU.Build.0 = netcoreapp-Debug|Any CPU
|
||||
{484C92C6-6D2C-45BC-A5E2-4A12BA228E1E}.Release|Any CPU.ActiveCfg = netcoreapp-Release|Any CPU
|
||||
{484C92C6-6D2C-45BC-A5E2-4A12BA228E1E}.Release|Any CPU.Build.0 = netcoreapp-Release|Any CPU
|
||||
{9A8926D9-1D4C-4069-8965-A626F6CA8C29}.Debug|Any CPU.ActiveCfg = netcoreapp-Debug|Any CPU
|
||||
{9A8926D9-1D4C-4069-8965-A626F6CA8C29}.Debug|Any CPU.Build.0 = netcoreapp-Debug|Any CPU
|
||||
{9A8926D9-1D4C-4069-8965-A626F6CA8C29}.Release|Any CPU.ActiveCfg = netcoreapp-Release|Any CPU
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace System.Globalization.Tests
|
||||
private static int s_rangeMinCodePoint;
|
||||
private static void Parse(List<CharUnicodeInfoTestCase> testCases, string line)
|
||||
{
|
||||
// Data is in the format:
|
||||
// Data is in the format:
|
||||
// code-value;
|
||||
// character-name;
|
||||
// general-category;
|
||||
@@ -48,7 +48,7 @@ namespace System.Globalization.Tests
|
||||
|
||||
int codePoint = int.Parse(charValueString, NumberStyles.HexNumber);
|
||||
Parse(testCases, codePoint, charCategoryString, numericValueString);
|
||||
|
||||
|
||||
if (charName.EndsWith("First>"))
|
||||
{
|
||||
s_rangeMinCodePoint = codePoint;
|
||||
@@ -110,7 +110,8 @@ namespace System.Globalization.Tests
|
||||
{
|
||||
Utf32CodeValue = codeValueRepresentation,
|
||||
GeneralCategory = generalCategory,
|
||||
NumericValue = numericValue
|
||||
NumericValue = numericValue,
|
||||
CodePoint = codePoint
|
||||
});
|
||||
}
|
||||
|
||||
@@ -144,6 +145,7 @@ namespace System.Globalization.Tests
|
||||
public class CharUnicodeInfoTestCase
|
||||
{
|
||||
public string Utf32CodeValue { get; set; }
|
||||
public int CodePoint { get; set; }
|
||||
public UnicodeCategory GeneralCategory { get; set; }
|
||||
public double NumericValue { get; set; }
|
||||
}
|
||||
|
||||
@@ -20,6 +20,9 @@ namespace System.Globalization.Tests
|
||||
}
|
||||
// Test the string overload for a surrogate pair or a single char
|
||||
GetUnicodeCategory(testCase.Utf32CodeValue, new UnicodeCategory[] { testCase.GeneralCategory });
|
||||
#if netcoreapp
|
||||
Assert.Equal(testCase.GeneralCategory, CharUnicodeInfo.GetUnicodeCategory(testCase.CodePoint));
|
||||
#endif // netcoreapp
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,65 +126,65 @@ namespace System.Globalization.Tests
|
||||
return $"CodeValue: {((int)ch).ToString("X")}; Expected: {expected}; Actual: {actual}";
|
||||
}
|
||||
|
||||
public static string s_numericsCodepoints =
|
||||
public static string s_numericsCodepoints =
|
||||
"\u0030\u0031\u0032\u0033\u0034\u0035\u0036\u0037\u0038\u0039" +
|
||||
"\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669" +
|
||||
"\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669" +
|
||||
"\u06f0\u06f1\u06f2\u06f3\u06f4\u06f5\u06f6\u06f7\u06f8\u06f9" +
|
||||
"\u07c0\u07c1\u07c2\u07c3\u07c4\u07c5\u07c6\u07c7\u07c8\u07c9" +
|
||||
"\u07c0\u07c1\u07c2\u07c3\u07c4\u07c5\u07c6\u07c7\u07c8\u07c9" +
|
||||
"\u0966\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f" +
|
||||
"\u09e6\u09e7\u09e8\u09e9\u09ea\u09eb\u09ec\u09ed\u09ee\u09ef" +
|
||||
"\u0a66\u0a67\u0a68\u0a69\u0a6a\u0a6b\u0a6c\u0a6d\u0a6e\u0a6f" +
|
||||
"\u0ae6\u0ae7\u0ae8\u0ae9\u0aea\u0aeb\u0aec\u0aed\u0aee\u0aef" +
|
||||
"\u0b66\u0b67\u0b68\u0b69\u0b6a\u0b6b\u0b6c\u0b6d\u0b6e\u0b6f" +
|
||||
"\u0be6\u0be7\u0be8\u0be9\u0bea\u0beb\u0bec\u0bed\u0bee\u0bef" +
|
||||
"\u0c66\u0c67\u0c68\u0c69\u0c6a\u0c6b\u0c6c\u0c6d\u0c6e\u0c6f" +
|
||||
"\u0ce6\u0ce7\u0ce8\u0ce9\u0cea\u0ceb\u0cec\u0ced\u0cee\u0cef" +
|
||||
"\u0d66\u0d67\u0d68\u0d69\u0d6a\u0d6b\u0d6c\u0d6d\u0d6e\u0d6f" +
|
||||
"\u0e50\u0e51\u0e52\u0e53\u0e54\u0e55\u0e56\u0e57\u0e58\u0e59" +
|
||||
"\u0ed0\u0ed1\u0ed2\u0ed3\u0ed4\u0ed5\u0ed6\u0ed7\u0ed8\u0ed9" +
|
||||
"\u0f20\u0f21\u0f22\u0f23\u0f24\u0f25\u0f26\u0f27\u0f28\u0f29" +
|
||||
"\u1040\u1041\u1042\u1043\u1044\u1045\u1046\u1047\u1048\u1049" +
|
||||
"\u1090\u1091\u1092\u1093\u1094\u1095\u1096\u1097\u1098\u1099" +
|
||||
"\u17e0\u17e1\u17e2\u17e3\u17e4\u17e5\u17e6\u17e7\u17e8\u17e9" +
|
||||
"\u1810\u1811\u1812\u1813\u1814\u1815\u1816\u1817\u1818\u1819" +
|
||||
"\u1946\u1947\u1948\u1949\u194a\u194b\u194c\u194d\u194e\u194f" +
|
||||
"\u19d0\u19d1\u19d2\u19d3\u19d4\u19d5\u19d6\u19d7\u19d8\u19d9" +
|
||||
"\u1a80\u1a81\u1a82\u1a83\u1a84\u1a85\u1a86\u1a87\u1a88\u1a89" +
|
||||
"\u1a90\u1a91\u1a92\u1a93\u1a94\u1a95\u1a96\u1a97\u1a98\u1a99" +
|
||||
"\u1b50\u1b51\u1b52\u1b53\u1b54\u1b55\u1b56\u1b57\u1b58\u1b59" +
|
||||
"\u1bb0\u1bb1\u1bb2\u1bb3\u1bb4\u1bb5\u1bb6\u1bb7\u1bb8\u1bb9" +
|
||||
"\u1c40\u1c41\u1c42\u1c43\u1c44\u1c45\u1c46\u1c47\u1c48\u1c49" +
|
||||
"\u1c50\u1c51\u1c52\u1c53\u1c54\u1c55\u1c56\u1c57\u1c58\u1c59" +
|
||||
"\ua620\ua621\ua622\ua623\ua624\ua625\ua626\ua627\ua628\ua629" +
|
||||
"\ua8d0\ua8d1\ua8d2\ua8d3\ua8d4\ua8d5\ua8d6\ua8d7\ua8d8\ua8d9" +
|
||||
"\ua900\ua901\ua902\ua903\ua904\ua905\ua906\ua907\ua908\ua909" +
|
||||
"\ua9d0\ua9d1\ua9d2\ua9d3\ua9d4\ua9d5\ua9d6\ua9d7\ua9d8\ua9d9" +
|
||||
"\uaa50\uaa51\uaa52\uaa53\uaa54\uaa55\uaa56\uaa57\uaa58\uaa59" +
|
||||
"\uabf0\uabf1\uabf2\uabf3\uabf4\uabf5\uabf6\uabf7\uabf8\uabf9" +
|
||||
"\u09e6\u09e7\u09e8\u09e9\u09ea\u09eb\u09ec\u09ed\u09ee\u09ef" +
|
||||
"\u0a66\u0a67\u0a68\u0a69\u0a6a\u0a6b\u0a6c\u0a6d\u0a6e\u0a6f" +
|
||||
"\u0ae6\u0ae7\u0ae8\u0ae9\u0aea\u0aeb\u0aec\u0aed\u0aee\u0aef" +
|
||||
"\u0b66\u0b67\u0b68\u0b69\u0b6a\u0b6b\u0b6c\u0b6d\u0b6e\u0b6f" +
|
||||
"\u0be6\u0be7\u0be8\u0be9\u0bea\u0beb\u0bec\u0bed\u0bee\u0bef" +
|
||||
"\u0c66\u0c67\u0c68\u0c69\u0c6a\u0c6b\u0c6c\u0c6d\u0c6e\u0c6f" +
|
||||
"\u0ce6\u0ce7\u0ce8\u0ce9\u0cea\u0ceb\u0cec\u0ced\u0cee\u0cef" +
|
||||
"\u0d66\u0d67\u0d68\u0d69\u0d6a\u0d6b\u0d6c\u0d6d\u0d6e\u0d6f" +
|
||||
"\u0e50\u0e51\u0e52\u0e53\u0e54\u0e55\u0e56\u0e57\u0e58\u0e59" +
|
||||
"\u0ed0\u0ed1\u0ed2\u0ed3\u0ed4\u0ed5\u0ed6\u0ed7\u0ed8\u0ed9" +
|
||||
"\u0f20\u0f21\u0f22\u0f23\u0f24\u0f25\u0f26\u0f27\u0f28\u0f29" +
|
||||
"\u1040\u1041\u1042\u1043\u1044\u1045\u1046\u1047\u1048\u1049" +
|
||||
"\u1090\u1091\u1092\u1093\u1094\u1095\u1096\u1097\u1098\u1099" +
|
||||
"\u17e0\u17e1\u17e2\u17e3\u17e4\u17e5\u17e6\u17e7\u17e8\u17e9" +
|
||||
"\u1810\u1811\u1812\u1813\u1814\u1815\u1816\u1817\u1818\u1819" +
|
||||
"\u1946\u1947\u1948\u1949\u194a\u194b\u194c\u194d\u194e\u194f" +
|
||||
"\u19d0\u19d1\u19d2\u19d3\u19d4\u19d5\u19d6\u19d7\u19d8\u19d9" +
|
||||
"\u1a80\u1a81\u1a82\u1a83\u1a84\u1a85\u1a86\u1a87\u1a88\u1a89" +
|
||||
"\u1a90\u1a91\u1a92\u1a93\u1a94\u1a95\u1a96\u1a97\u1a98\u1a99" +
|
||||
"\u1b50\u1b51\u1b52\u1b53\u1b54\u1b55\u1b56\u1b57\u1b58\u1b59" +
|
||||
"\u1bb0\u1bb1\u1bb2\u1bb3\u1bb4\u1bb5\u1bb6\u1bb7\u1bb8\u1bb9" +
|
||||
"\u1c40\u1c41\u1c42\u1c43\u1c44\u1c45\u1c46\u1c47\u1c48\u1c49" +
|
||||
"\u1c50\u1c51\u1c52\u1c53\u1c54\u1c55\u1c56\u1c57\u1c58\u1c59" +
|
||||
"\ua620\ua621\ua622\ua623\ua624\ua625\ua626\ua627\ua628\ua629" +
|
||||
"\ua8d0\ua8d1\ua8d2\ua8d3\ua8d4\ua8d5\ua8d6\ua8d7\ua8d8\ua8d9" +
|
||||
"\ua900\ua901\ua902\ua903\ua904\ua905\ua906\ua907\ua908\ua909" +
|
||||
"\ua9d0\ua9d1\ua9d2\ua9d3\ua9d4\ua9d5\ua9d6\ua9d7\ua9d8\ua9d9" +
|
||||
"\uaa50\uaa51\uaa52\uaa53\uaa54\uaa55\uaa56\uaa57\uaa58\uaa59" +
|
||||
"\uabf0\uabf1\uabf2\uabf3\uabf4\uabf5\uabf6\uabf7\uabf8\uabf9" +
|
||||
"\uff10\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19";
|
||||
|
||||
public static string s_nonNumericsCodepoints =
|
||||
public static string s_nonNumericsCodepoints =
|
||||
"abcdefghijklmnopqrstuvwxyz" +
|
||||
"\u1369\u136a\u136b\u136c\u136d\u136e\u136f\u1370\u1371\u1372\u1373" +
|
||||
"\u1369\u136a\u136b\u136c\u136d\u136e\u136f\u1370\u1371\u1372\u1373" +
|
||||
"\u1374\u1375\u1376\u1377\u1378\u1379\u137a\u137b\u137c\u137d";
|
||||
|
||||
public static string s_numericNonDecimalCodepoints =
|
||||
"\u00b2\u00b3\u00b9\u1369\u136a\u136b\u136c\u136d\u136e\u136f\u1370" +
|
||||
"\u1371\u19da\u2070\u2074\u2075\u2076\u2077\u2078\u2079\u2080\u2081" +
|
||||
"\u2082\u2083\u2084\u2085\u2086\u2087\u2088\u2089\u2460\u2461\u2462" +
|
||||
"\u2463\u2464\u2465\u2466\u2467\u2468\u2474\u2475\u2476\u2477\u2478" +
|
||||
"\u2479\u247a\u247b\u247c\u2488\u2489\u248a\u248b\u248c\u248d\u248e" +
|
||||
"\u248f\u2490\u24ea\u24f5\u24f6\u24f7\u24f8\u24f9\u24fa\u24fb\u24fc" +
|
||||
"\u00b2\u00b3\u00b9\u1369\u136a\u136b\u136c\u136d\u136e\u136f\u1370" +
|
||||
"\u1371\u19da\u2070\u2074\u2075\u2076\u2077\u2078\u2079\u2080\u2081" +
|
||||
"\u2082\u2083\u2084\u2085\u2086\u2087\u2088\u2089\u2460\u2461\u2462" +
|
||||
"\u2463\u2464\u2465\u2466\u2467\u2468\u2474\u2475\u2476\u2477\u2478" +
|
||||
"\u2479\u247a\u247b\u247c\u2488\u2489\u248a\u248b\u248c\u248d\u248e" +
|
||||
"\u248f\u2490\u24ea\u24f5\u24f6\u24f7\u24f8\u24f9\u24fa\u24fb\u24fc" +
|
||||
"\u24fd\u24ff\u2776\u2777\u2778\u2779\u277a\u277b\u277c\u277d\u277e" +
|
||||
"\u2780\u2781\u2782\u2783\u2784\u2785\u2786\u2787\u2788\u278a\u278b" +
|
||||
"\u278c\u278d\u278e\u278f\u2790\u2791\u2792";
|
||||
|
||||
public static int [] s_numericNonDecimalValues = new int []
|
||||
{
|
||||
2, 3, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 0, 4, 5, 6, 7, 8, 9, 0, 1, 2,
|
||||
3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7,
|
||||
8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1,
|
||||
2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6,
|
||||
{
|
||||
2, 3, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 0, 4, 5, 6, 7, 8, 9, 0, 1, 2,
|
||||
3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7,
|
||||
8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1,
|
||||
2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6,
|
||||
7, 8, 9
|
||||
};
|
||||
|
||||
@@ -195,7 +198,7 @@ namespace System.Globalization.Tests
|
||||
{
|
||||
Assert.Equal(j, CharUnicodeInfo.GetDecimalDigitValue(s_numericsCodepoints[i + j]));
|
||||
Assert.Equal(j, CharUnicodeInfo.GetDecimalDigitValue(s_numericsCodepoints, i + j));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<BuildConfigurations>
|
||||
netstandard;
|
||||
netcoreapp;
|
||||
uap-Windows_NT;
|
||||
</BuildConfigurations>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -629,7 +629,6 @@ namespace System.Globalization.Tests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[ActiveIssue("TFS 444333 - Should ExceptionMiniaturizer exempt CultureNotFoundException.InvalidCultureName from being optimized away?", TargetFrameworkMonikers.UapAot)]
|
||||
public void CultureNotFoundExceptionTest()
|
||||
{
|
||||
AssertExtensions.Throws<CultureNotFoundException>("name", () => new CultureInfo("!@#$%^&*()"));
|
||||
|
||||
@@ -59,12 +59,12 @@ namespace System.Globalization.Tests
|
||||
expectedFormattedString = formattedTime.Replace(timeSep, dtfi.TimeSeparator);
|
||||
Assert.Equal(expectedFormattedString, d.ToString("HH:mm:ss", dtfi));
|
||||
}
|
||||
|
||||
|
||||
[Theory]
|
||||
[MemberData(nameof(DateTimeFormatInfo_TestData))]
|
||||
public void NativeCalendarNameTest(DateTimeFormatInfo dtfi, Calendar calendar, string nativeCalendarName)
|
||||
{
|
||||
try
|
||||
try
|
||||
{
|
||||
dtfi.Calendar = calendar;
|
||||
Assert.Equal(nativeCalendarName, dtfi.NativeCalendarName);
|
||||
@@ -77,8 +77,8 @@ namespace System.Globalization.Tests
|
||||
Assert.True(calendar is PersianCalendar, "Exception can occur only with PersianCalendar");
|
||||
}
|
||||
else // !PlatformDetection.IsWindows
|
||||
{
|
||||
Assert.True(calendar is HijriCalendar || calendar is UmAlQuraCalendar || calendar is ThaiBuddhistCalendar ||
|
||||
{
|
||||
Assert.True(calendar is HijriCalendar || calendar is UmAlQuraCalendar || calendar is ThaiBuddhistCalendar ||
|
||||
calendar is HebrewCalendar || calendar is KoreanCalendar, "failed to set the calendar on DTFI");
|
||||
}
|
||||
}
|
||||
@@ -131,7 +131,35 @@ namespace System.Globalization.Tests
|
||||
for (DayOfWeek day=DayOfWeek.Sunday; day <= DayOfWeek.Saturday; day++)
|
||||
{
|
||||
Assert.Equal(shortestDayNames[(int) day], dtfi.GetShortestDayName(day));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestHebrewMonths()
|
||||
{
|
||||
CultureInfo ci = new CultureInfo("he-IL");
|
||||
ci.DateTimeFormat.Calendar = new HebrewCalendar();
|
||||
|
||||
Assert.Equal(13, ci.DateTimeFormat.MonthNames.Length);
|
||||
Assert.Equal(13, ci.DateTimeFormat.MonthGenitiveNames.Length);
|
||||
Assert.Equal(13, ci.DateTimeFormat.AbbreviatedMonthNames.Length);
|
||||
Assert.Equal(13, ci.DateTimeFormat.AbbreviatedMonthGenitiveNames.Length);
|
||||
|
||||
DateTime dt = ci.DateTimeFormat.Calendar.ToDateTime(5779, 1, 1, 0, 0, 0, 0); // leap year
|
||||
for (int i = 0; i < 13; i++)
|
||||
{
|
||||
string formatted = dt.ToString(ci.DateTimeFormat.LongDatePattern, ci);
|
||||
Assert.Equal(dt, DateTime.ParseExact(formatted, ci.DateTimeFormat.LongDatePattern, ci));
|
||||
dt = ci.DateTimeFormat.Calendar.AddMonths(dt, 1);
|
||||
}
|
||||
|
||||
dt = ci.DateTimeFormat.Calendar.ToDateTime(5778, 1, 1, 0, 0, 0, 0); // non leap year
|
||||
for (int i = 0; i < 12; i++)
|
||||
{
|
||||
string formatted = dt.ToString(ci.DateTimeFormat.LongDatePattern, ci);
|
||||
Assert.Equal(dt, DateTime.ParseExact(formatted, ci.DateTimeFormat.LongDatePattern, ci));
|
||||
dt = ci.DateTimeFormat.Calendar.AddMonths(dt, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
using Xunit;
|
||||
|
||||
@@ -71,7 +72,7 @@ namespace System.Globalization.Tests
|
||||
yield return new object[] { "a", "A", 0, 1, CompareOptions.Ordinal, -1 };
|
||||
yield return new object[] { "abc", "aBc", 0, 3, CompareOptions.Ordinal, -1 };
|
||||
|
||||
// Ordinal with numbers and
|
||||
// Ordinal with numbers and
|
||||
yield return new object[] { "a", "1", 0, 1, CompareOptions.Ordinal, -1 };
|
||||
yield return new object[] { "1", "1", 0, 1, CompareOptions.Ordinal, 0 };
|
||||
yield return new object[] { "1", "!", 0, 1, CompareOptions.Ordinal, -1 };
|
||||
@@ -144,7 +145,7 @@ namespace System.Globalization.Tests
|
||||
yield return new object[] { "foobardzsdzs", "rddzs", 11, 12, CompareOptions.None, -1 };
|
||||
yield return new object[] { "foobardzsdzs", "rddzs", 11, 12, CompareOptions.Ordinal, -1 };
|
||||
|
||||
// Turkish
|
||||
// Turkish
|
||||
yield return new object[] { "Hi", "I", 1, 2, CompareOptions.None, -1 };
|
||||
yield return new object[] { "Hi", "I", 1, 2, CompareOptions.IgnoreCase, 1 };
|
||||
yield return new object[] { "Hi", "\u0130", 1, 2, CompareOptions.None, -1 };
|
||||
@@ -190,7 +191,7 @@ namespace System.Globalization.Tests
|
||||
yield return new object[] { "dzsdzsfoobar", "ddzsf", CompareOptions.Ordinal, false };
|
||||
yield return new object[] { "dzsdzsfoobar", "ddzsf", CompareOptions.Ordinal, false };
|
||||
|
||||
// Turkish
|
||||
// Turkish
|
||||
yield return new object[] { "interesting", "I", CompareOptions.None, false };
|
||||
yield return new object[] { "interesting", "I", CompareOptions.IgnoreCase, true };
|
||||
yield return new object[] { "interesting", "\u0130", CompareOptions.None, false };
|
||||
@@ -227,7 +228,7 @@ namespace System.Globalization.Tests
|
||||
yield return new object[] { "foobardzsdzs", "rddzs", CompareOptions.Ordinal, false };
|
||||
yield return new object[] { "foobardzsdzs", "rddzs", CompareOptions.None, false };
|
||||
|
||||
// Turkish
|
||||
// Turkish
|
||||
yield return new object[] { "Hi", "I", CompareOptions.None, false };
|
||||
yield return new object[] { "Hi", "I", CompareOptions.IgnoreCase, true };
|
||||
yield return new object[] { "Hi", "\u0130", CompareOptions.None, false };
|
||||
@@ -245,7 +246,7 @@ namespace System.Globalization.Tests
|
||||
yield return new object[] { "More Test's", "Tests", CompareOptions.IgnoreSymbols, false };
|
||||
yield return new object[] { "More Test's", "Tests", CompareOptions.None, false };
|
||||
|
||||
// Platform differences
|
||||
// Platform differences
|
||||
yield return new object[] { "foobardzsdzs", "rddzs", CompareOptions.None, false };
|
||||
}
|
||||
|
||||
@@ -374,10 +375,10 @@ namespace System.Globalization.Tests
|
||||
yield return new object[] { "this \t HaS \t somE \t TABS", "THIS \t HAS \t SOME \t TABS", true };
|
||||
|
||||
yield return new object[] { "embedded\0NuLL\0Byte\0", "EMBEDDED\0NULL\0BYTE\0", true };
|
||||
|
||||
|
||||
// LATIN SMALL LETTER O WITH ACUTE, which has an upper case variant.
|
||||
yield return new object[] { "\u00F3", "\u00D3", false };
|
||||
|
||||
|
||||
// SNOWMAN, which does not have an upper case variant.
|
||||
yield return new object[] { "\u2603", "\u2603", true };
|
||||
|
||||
@@ -438,7 +439,7 @@ namespace System.Globalization.Tests
|
||||
{
|
||||
yield return new object[] { "xn--yda", 0, 7, "\u0101" };
|
||||
yield return new object[] { "axn--ydab", 1, 7, "\u0101" };
|
||||
|
||||
|
||||
yield return new object[] { "xn--aa-cla", 0, 10, "\u0101\u0061a" };
|
||||
yield return new object[] { "xn--ab-dla", 0, 10, "\u0061\u0101\u0062" };
|
||||
yield return new object[] { "xn--ab-ela", 0, 10, "\u0061\u0062\u0101" };
|
||||
@@ -453,10 +454,10 @@ namespace System.Globalization.Tests
|
||||
yield return new object[] { "abc.xn--d9juau41awczczp.xn--de-jg4avhby1noc0d", 0, 45, "\u0061\u0062\u0063.\u305D\u306E\u30B9\u30D4\u30FC\u30C9\u3067.\u30D1\u30D5\u30A3\u30FC\u0064\u0065\u30EB\u30F3\u30D0" }; // Fully qualified domain name
|
||||
|
||||
// Embedded domain name conversion (NLS + only)(Priority 1)
|
||||
// Per the spec [7], "The index and count parameters (when provided) allow the
|
||||
// conversion to be done on a larger string where the domain name is embedded
|
||||
// (such as a URI or IRI). The output string is only the converted FQDN or
|
||||
// label, not the whole input string (if the input string contains more
|
||||
// Per the spec [7], "The index and count parameters (when provided) allow the
|
||||
// conversion to be done on a larger string where the domain name is embedded
|
||||
// (such as a URI or IRI). The output string is only the converted FQDN or
|
||||
// label, not the whole input string (if the input string contains more
|
||||
// character than the substring to convert)."
|
||||
// Fully Qualified Domain Name (Label1.Label2.Label3)
|
||||
yield return new object[] { "abc.xn--d9juau41awczczp.xn--de-jg4avhby1noc0d", 0, 45, "\u0061\u0062\u0063.\u305D\u306E\u30B9\u30D4\u30FC\u30C9\u3067.\u30D1\u30D5\u30A3\u30FC\u0064\u0065\u30EB\u30F3\u30D0" };
|
||||
@@ -476,7 +477,7 @@ namespace System.Globalization.Tests
|
||||
|
||||
//
|
||||
// DateTimeInfo
|
||||
//
|
||||
//
|
||||
|
||||
Assert.Equal(CultureInfo.InvariantCulture.DateTimeFormat.AbbreviatedDayNames, ci.DateTimeFormat.AbbreviatedDayNames);
|
||||
Assert.Equal(CultureInfo.InvariantCulture.DateTimeFormat.AbbreviatedMonthGenitiveNames, ci.DateTimeFormat.AbbreviatedMonthGenitiveNames);
|
||||
@@ -523,7 +524,7 @@ namespace System.Globalization.Tests
|
||||
|
||||
//
|
||||
// Culture data
|
||||
//
|
||||
//
|
||||
|
||||
Assert.True(ci.Calendar is GregorianCalendar);
|
||||
|
||||
@@ -692,7 +693,7 @@ namespace System.Globalization.Tests
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
[Theory]
|
||||
[MemberData(nameof(Compare_TestData))]
|
||||
public void TestCompare(string source, string value, CompareOptions options, int result)
|
||||
@@ -784,5 +785,14 @@ namespace System.Globalization.Tests
|
||||
}
|
||||
Assert.Equal(expected, new IdnMapping().GetUnicode(ascii, index, count));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestHashing()
|
||||
{
|
||||
StringComparer cultureComparer = StringComparer.Create(CultureInfo.GetCultureInfo("tr-TR"), true);
|
||||
StringComparer ordinalComparer = StringComparer.OrdinalIgnoreCase;
|
||||
string turkishString = "i\u0130";
|
||||
Assert.Equal(ordinalComparer.GetHashCode(turkishString), cultureComparer.GetHashCode(turkishString));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ namespace System.Globalization.Tests
|
||||
public static IEnumerable<object[]> CurrencyNegativePattern_TestData()
|
||||
{
|
||||
yield return new object[] { NumberFormatInfo.InvariantInfo, new int[] { 0 } };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("bg-BG").NumberFormat, new int[] { 8 } };
|
||||
yield return new object[] { CultureInfo.GetCultureInfo("bg-BG").NumberFormat, new int[] { 0, 8 } };
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
||||
@@ -39,10 +39,14 @@ namespace System.Globalization.Tests
|
||||
{
|
||||
return (PlatformDetection.WindowsVersion < 10) ? new int[] { 3 } : new int[] { 6, 3 };
|
||||
}
|
||||
if (PlatformDetection.ICUVersion.Major >= 59)
|
||||
if (PlatformDetection.ICUVersion.Major == 59 || PlatformDetection.ICUVersion.Major == 58)
|
||||
{
|
||||
return new int[] { 8 };
|
||||
}
|
||||
else if (PlatformDetection.ICUVersion.Major > 59)
|
||||
{
|
||||
return new int[] { 1 };
|
||||
}
|
||||
else
|
||||
{
|
||||
return new int[] { 1, 0 };
|
||||
|
||||
@@ -101,22 +101,22 @@ namespace System.Globalization.Tests
|
||||
yield return new object[] { 0x409, 244, "US Dollar", "US Dollar", "\u0055\u0053\u0020\u0044\u006f\u006c\u006c\u0061\u0072", "USA", "USA" };
|
||||
yield return new object[] { 0x411, 122, "Japanese Yen", "Japanese Yen", PlatformDetection.IsWindows ? "\u5186" : "\u65e5\u672c\u5186", "JPN", "JPN" };
|
||||
yield return new object[] { 0x804, 45, "Chinese Yuan", "PRC Yuan Renminbi", "\u4eba\u6c11\u5e01", "CHN", "CHN" };
|
||||
yield return new object[] { 0x401, 205, "Saudi Riyal", "Saudi Riyal", PlatformDetection.IsWindows ?
|
||||
"\u0631\u064a\u0627\u0644\u00a0\u0633\u0639\u0648\u062f\u064a" :
|
||||
"\u0631\u064a\u0627\u0644\u0020\u0633\u0639\u0648\u062f\u064a",
|
||||
yield return new object[] { 0x401, 205, "Saudi Riyal", "Saudi Riyal", PlatformDetection.IsWindows ?
|
||||
"\u0631\u064a\u0627\u0644\u00a0\u0633\u0639\u0648\u062f\u064a" :
|
||||
"\u0631\u064a\u0627\u0644\u0020\u0633\u0639\u0648\u062f\u064a",
|
||||
"SAU", "SAU" };
|
||||
yield return new object[] { 0x412, 134, "South Korean Won", "Korean Won", PlatformDetection.IsWindows ? "\uc6d0" : "\ub300\ud55c\ubbfc\uad6d\u0020\uc6d0", "KOR", "KOR" };
|
||||
yield return new object[] { 0x40d, 117, "Israeli New Shekel", "Israeli New Sheqel",
|
||||
PlatformDetection.IsWindows || PlatformDetection.ICUVersion.Major >= 59 ? "\u05e9\u05e7\u05dc\u0020\u05d7\u05d3\u05e9" : "\u05e9\u05f4\u05d7", "ISR", "ISR" };
|
||||
yield return new object[] { 0x40d, 117, "Israeli New Shekel", "Israeli New Sheqel",
|
||||
PlatformDetection.IsWindows || PlatformDetection.ICUVersion.Major >= 58 ? "\u05e9\u05e7\u05dc\u0020\u05d7\u05d3\u05e9" : "\u05e9\u05f4\u05d7", "ISR", "ISR" };
|
||||
}
|
||||
|
||||
|
||||
[Theory]
|
||||
[MemberData(nameof(RegionInfo_TestData))]
|
||||
public void MiscTest(int lcid, int geoId, string currencyEnglishName, string alternativeCurrencyEnglishName, string currencyNativeName, string threeLetterISORegionName, string threeLetterWindowsRegionName)
|
||||
{
|
||||
RegionInfo ri = new RegionInfo(lcid); // create it with lcid
|
||||
Assert.Equal(geoId, ri.GeoId);
|
||||
Assert.True(currencyEnglishName.Equals(ri.CurrencyEnglishName) ||
|
||||
Assert.True(currencyEnglishName.Equals(ri.CurrencyEnglishName) ||
|
||||
alternativeCurrencyEnglishName.Equals(ri.CurrencyEnglishName), "Wrong currency English Name");
|
||||
Assert.Equal(currencyNativeName, ri.CurrencyNativeName);
|
||||
Assert.Equal(threeLetterISORegionName, ri.ThreeLetterISORegionName);
|
||||
|
||||
@@ -5,9 +5,12 @@
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<ProjectGuid>{484C92C6-6D2C-45BC-A5E2-4A12BA228E1E}</ProjectGuid>
|
||||
<DefineConstants Condition="'$(TargetGroup)' == 'uap'">$(DefineConstants);uap</DefineConstants>
|
||||
<DefineConstants Condition="'$(TargetGroup)' == 'netcoreapp'">$(DefineConstants);netcoreapp</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Release|AnyCPU'" />
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user