Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -133,12 +133,10 @@ public class CalendarTest {
private TaiwanCalendar tacal;
private KoreanCalendar kcal;
private ThaiBuddhistCalendar tbcal;
#if NET_2_0
private ChineseLunisolarCalendar clcal;
private TaiwanLunisolarCalendar tlcal;
private JapaneseLunisolarCalendar jlcal;
private KoreanLunisolarCalendar klcal;
#endif
[SetUp]
protected void SetUp() {
@@ -153,12 +151,10 @@ public class CalendarTest {
acal = new Calendar[] {
gcal, jucal, hical, hecal, jacal,
tacal, kcal, tbcal};
#if NET_2_0
clcal = new ChineseLunisolarCalendar ();
tlcal = new TaiwanLunisolarCalendar ();
jlcal = new JapaneseLunisolarCalendar ();
klcal = new KoreanLunisolarCalendar ();
#endif
}
private void RowCheck(params Date[] adate) {
@@ -468,11 +464,9 @@ public class CalendarTest {
Assert.AreEqual(1, KoreanCalendar.KoreanEra, "B05 KoreanEra");
Assert.AreEqual(1, ThaiBuddhistCalendar.ThaiBuddhistEra, "B06 ThaiBuddhistEra");
#if NET_2_0
Assert.AreEqual(1, ChineseLunisolarCalendar.ChineseEra, "CNLunisor");
Assert.AreEqual(1, JapaneseLunisolarCalendar.JapaneseEra, "JPLunisor");
Assert.AreEqual(1, KoreanLunisolarCalendar.GregorianEra, "KRLunisor");
#endif
}
[Test]
@@ -508,8 +502,6 @@ public class CalendarTest {
}
}
#if NET_2_0
[Category ("NotWorking")]
[Test]
public void TestErasProperty2() {
Assert.AreEqual(1, clcal.Eras.Length, "cn");
@@ -520,7 +512,6 @@ public class CalendarTest {
Assert.AreEqual(4, jlcal.Eras [0], "jp.1");
Assert.AreEqual(3, jlcal.Eras [1], "jp.2");
}
#endif
[Test]
public void TestTwoDigitYearMax() {
@@ -548,7 +539,8 @@ public class CalendarTest {
catch (ArgumentOutOfRangeException) {
exception = true;
}
Assert.IsTrue(exception,
Assert.IsFalse(exception,
String.Format("E09 {0}.TwoDigitYearMax 99 " +
" out of range exception", cal));
@@ -606,9 +598,7 @@ public class CalendarTest {
Assert.AreEqual (2, next.Month, "next");
}
#if NET_2_0
[Test]
[Category ("NotWorking")]
public void GetLeapMonth ()
{
GregorianCalendar gc = new GregorianCalendar ();
@@ -699,7 +689,6 @@ public class CalendarTest {
Assert.AreEqual (52, gc.GetWeekOfYear (new DateTime (2000, 1, 1), CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Sunday), "#5");
Assert.AreEqual (52, gc.GetWeekOfYear (new DateTime (2000, 1, 1), CalendarWeekRule.FirstFullWeek, DayOfWeek.Sunday), "#6");
}
#endif
[Test]
public void TestToFourDigitYear() {

View File

@@ -502,7 +502,6 @@ public class CompareInfoTest
Array values = Enum.GetValues (typeof (CompareOptions));
foreach (int i in values) {
CompareOptions option = (CompareOptions) i;
#if NET_2_0
if (option == CompareOptions.OrdinalIgnoreCase || option == CompareOptions.Ordinal) {
try {
french.GetSortKey ("foo", option);
@@ -517,16 +516,11 @@ public class CompareInfoTest
} else {
french.GetSortKey ("foo", option);
}
#else
french.GetSortKey ("foo", option);
#endif
}
}
[Test]
#if NET_2_0
[Category ("NotDotNet")]
#endif
public void FrenchSort ()
{
if (!doTest)
@@ -706,9 +700,7 @@ public class CompareInfoTest
}
[Test]
#if NET_2_0
[Category ("NotDotNet")]
#endif
public void CultureSensitiveCompare ()
{
if (!doTest)
@@ -760,9 +752,7 @@ public class CompareInfoTest
}
[Test]
#if NET_2_0
[Category ("NotDotNet")]
#endif
public void CompareSpecialWeight ()
{
if (!doTest)
@@ -853,9 +843,7 @@ public class CompareInfoTest
}
[Test]
#if NET_2_0
[Category ("NotDotNet")]
#endif
public void IsPrefix ()
{
if (!doTest)
@@ -922,9 +910,7 @@ public class CompareInfoTest
}
[Test]
#if NET_2_0
[Category ("NotDotNet")]
#endif
public void IsSuffix ()
{
if (!doTest)
@@ -1010,9 +996,7 @@ public class CompareInfoTest
}
[Test]
#if NET_2_0
[Category ("NotDotNet")]
#endif
public void IndexOfStringWeird ()
{
// BUG in .NET 2.0 : see GetSortKey() test (mentioned above).
@@ -1170,7 +1154,6 @@ public class CompareInfoTest
Assert.AreEqual (0, "MONO".CompareTo ("MONO\0\0\0"), "#4");
}
#if NET_2_0
[Test]
[Category ("NotDotNet")]
public void OrdinalIgnoreCaseCompare ()
@@ -1241,7 +1224,6 @@ public class CompareInfoTest
{
Assert.IsTrue ("aaaa".StartsWith ("A", StringComparison.OrdinalIgnoreCase));
}
#endif
[Test]
[ExpectedException (typeof (ArgumentNullException))]

View File

@@ -579,6 +579,15 @@ namespace MonoTests.System.Globalization
Assert.AreEqual (31748, new CultureInfo ("zh-CHT").Parent.LCID);
}
[Test]
public void ZhHans ()
{
Assert.AreEqual (4, new CultureInfo ("zh-Hans").LCID);
Assert.AreEqual (4, CultureInfo.GetCultureInfo ("zh-Hans").LCID);
Assert.AreEqual (4, new CultureInfo ("zh-CHS").LCID);
Assert.AreEqual (4, new CultureInfo ("zh-CHS").Parent.LCID);
}
[Test]
[SetCulture ("zh-TW")]
public void ParentOfZh ()

View File

@@ -27,7 +27,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using NUnit.Framework;
using System;
@@ -46,7 +45,6 @@ namespace MonoTests.System.Globalization
static KoreanLunisolarCalendar kr = new KoreanLunisolarCalendar ();
[Test]
[Category ("NotWorking")]
public void ToDateTime ()
{
Assert.AreEqual (new DateTime (2000, 2, 5), cn.ToDateTime (2000, 1, 1, 0, 0, 0, 0), "cn1");
@@ -86,7 +84,6 @@ namespace MonoTests.System.Globalization
}
[Test]
[Category ("NotWorking")]
public void ToDateTimeOutOfRange ()
{
try {
@@ -101,34 +98,6 @@ namespace MonoTests.System.Globalization
}
}
[Test]
[Category ("NotWorking")]
public void GetYear ()
{
Assert.AreEqual (1901, cn.GetYear (new DateTime (1901, 2, 19, 0, 0, 0, DateTimeKind.Utc).ToLocalTime ()), "#1");
Assert.AreEqual (1901, cn.GetYear (new DateTime (1902, 2, 07, 0, 0, 0, DateTimeKind.Utc).ToLocalTime ()), "#2");
Assert.AreEqual (1902, cn.GetYear (new DateTime (1902, 2, 08, 0, 0, 0, DateTimeKind.Utc).ToLocalTime ()), "#3");
Assert.AreEqual (1902, cn.GetYear (new DateTime (1903, 1, 28, 0, 0, 0, DateTimeKind.Utc).ToLocalTime ()), "#4");
Assert.AreEqual (1903, cn.GetYear (new DateTime (1903, 1, 29, 0, 0, 0, DateTimeKind.Utc).ToLocalTime ()), "#5");
// there was a leap month
Assert.AreEqual (1903, cn.GetYear (new DateTime (1904, 2, 15, 0, 0, 0, DateTimeKind.Utc).ToLocalTime ()), "#6");
Assert.AreEqual (1904, cn.GetYear (new DateTime (1904, 2, 16, 0, 0, 0, DateTimeKind.Utc).ToLocalTime ()), "#7");
}
[Test]
[Category ("NotWorking")]
public void GetYear2 ()
{
Assert.AreEqual (1999, cn.GetYear (new DateTime (2000, 2, 4, 0, 0, 0, DateTimeKind.Utc).ToLocalTime ()), "#1");
Assert.AreEqual (2000, cn.GetYear (new DateTime (2000, 2, 5, 0, 0, 0, DateTimeKind.Utc).ToLocalTime ()), "#2");
Assert.AreEqual (11, jp.GetYear (new DateTime (2000, 2, 4, 0, 0, 0, DateTimeKind.Utc).ToLocalTime ()), "#3");
Assert.AreEqual (12, jp.GetYear (new DateTime (2000, 2, 5, 0, 0, 0, DateTimeKind.Utc).ToLocalTime ()), "#4");
Assert.AreEqual (88, tw.GetYear (new DateTime (2000, 2, 4, 0, 0, 0, DateTimeKind.Utc).ToLocalTime ()), "#5");
Assert.AreEqual (89, tw.GetYear (new DateTime (2000, 2, 5, 0, 0, 0, DateTimeKind.Utc).ToLocalTime ()), "#6");
Assert.AreEqual (1999, cn.GetYear (new DateTime (2000, 2, 4, 0, 0, 0, DateTimeKind.Utc).ToLocalTime ()), "#7");
Assert.AreEqual (2000, cn.GetYear (new DateTime (2000, 2, 5, 0, 0, 0, DateTimeKind.Utc).ToLocalTime ()), "#8");
}
bool [] leapYears = new bool [] {
false, true, false, false, true,
false, true, false, false, true,
@@ -137,7 +106,6 @@ namespace MonoTests.System.Globalization
};
[Test]
[Category ("NotWorking")]
public void IsLeapYear ()
{
//Assert.IsFalse (cn.IsLeapYear (1901), "#cn1901");
@@ -159,7 +127,6 @@ namespace MonoTests.System.Globalization
}
[Test]
[Category ("NotWorking")]
public void IsLeapMonth ()
{
Dictionary<int,int> d = new Dictionary<int,int> ();
@@ -227,4 +194,3 @@ namespace MonoTests.System.Globalization
}
}
#endif

View File

@@ -26,7 +26,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using NUnit.Framework;
using System.IO;
@@ -122,7 +121,7 @@ namespace MonoTests.System.Globalization
public void UnassignedCharacter ()
{
IdnMapping m = new IdnMapping ();
GetAsciiInvalid (m, "\u18b0.com", 1);
//GetAsciiInvalid (m, "\u18b0.com", 1);
m.AllowUnassigned = true;
GetAscii (m, "\u18b0.com", "xn--6bf.com", 2);
}
@@ -194,4 +193,3 @@ namespace MonoTests.System.Globalization
}
}
#endif

View File

@@ -29,9 +29,7 @@ namespace MonoTests.System.Globalization
Assert.AreEqual ("B", StringInfo.GetNextTextElement ("A\u0330BC", 2), "#4");
// hmm ...
#if NET_2_0 // it causes ArgumentOutOfRangeException in 1.x, not worthy to test it anymore
Assert.AreEqual (String.Empty, StringInfo.GetNextTextElement ("A\u0330BC", 4), "#4");
#endif
}
[Test]
@@ -41,7 +39,6 @@ namespace MonoTests.System.Globalization
StringInfo.GetNextTextElement ("ABC", -1);
}
#if NET_2_0
[Test]
public void LengthInTextElements ()
{
@@ -87,7 +84,6 @@ namespace MonoTests.System.Globalization
{
new StringInfo (String.Empty).SubstringByTextElements (0);
}
#endif
}
}