Просмотр исходного кода

2003-03-05 Gonzalo Paniagua Javier <[email protected]>

	* ASCIIEncodingTest.cs: added a couple of asserts fot zero-length
	arrays.

svn path=/trunk/mcs/; revision=12234
Gonzalo Paniagua Javier 23 лет назад
Родитель
Сommit
5ea869194c

+ 7 - 0
mcs/class/corlib/Test/System.Text/ASCIIEncodingTest.cs

@@ -164,6 +164,13 @@ namespace MonoTests.System.Text {
                 	AssertEquals (testchars[1], (char) bytes[0]);
 		}
 
+		public void TestZero ()
+		{
+			Encoding encoding = Encoding.ASCII;
+			AssertEquals ("#01", encoding.GetString (new byte [0]), "");
+			AssertEquals ("#02", encoding.GetString (new byte [0], 0, 0), "");
+		}
+
 	}
 
 }

+ 5 - 0
mcs/class/corlib/Test/System.Text/ChangeLog

@@ -1,3 +1,8 @@
+2003-03-05  Gonzalo Paniagua Javier <[email protected]>
+
+	* ASCIIEncodingTest.cs: added a couple of asserts fot zero-length
+	arrays.
+
 2003-02-05  Nick Drochak  <[email protected]>
 
 	* StringBuilderTest.cs: Test for specific exception using Nunit verson