[corlib/Tests] Added test for bug #30171
authorMiguel de Icaza <miguel@gnome.org>
Mon, 18 May 2015 22:04:05 +0000 (18:04 -0400)
committerMiguel de Icaza <miguel@gnome.org>
Mon, 18 May 2015 22:04:05 +0000 (18:04 -0400)
mcs/class/corlib/Test/System.IO/BinaryReaderTest.cs

index 57e77b8b6149b617ce9f9e804ce9e97f43fbb039..aac304e5c76a2435b9d9da646059e4a8910bddd7 100644 (file)
@@ -1562,5 +1562,22 @@ namespace MonoTests.System.IO
                        }
                }
        }
+
+       // Bug Xamarin #30171
+       [Test]
+       public void BinaryReaderRegressionMono40 ()
+       {
+               char testChar1 = 'H';
+               using (var stream = new MemoryStream()){
+                       using (var writer = new BinaryWriter(stream, Encoding.Unicode, true)){
+                               using (var reader = new BinaryReader(stream, Encoding.Unicode)) {
+                                       writer.Write(testChar1);
+                                       stream.Position = 0;
+                                       char testchar2 = reader.ReadChar();
+                                       Assert.AreEqual (testChar1, testchar2);
+                               }
+                       }
+               }
+       }
 }
 }