Merge pull request #1304 from slluis/mac-proxy-autoconfig
[mono.git] / mcs / class / System / Test / System.Text.RegularExpressions / RegexTest.cs
index 4f077e47bc57e1b1c5019042b7d44b3d678d1bea..f5208ce99de0e39dfdea201a5222d945b471e435 100644 (file)
@@ -217,6 +217,27 @@ namespace MonoTests.System.Text.RegularExpressions
                                   AddOptions(RegexOptions.RightToLeft)).Matches (null);
                }
 
+               [Test]
+               public void Match_SubstringAnchors ()
+               {
+                       Regex r = new Regex ("^ooba$",
+                                            AddOptions( RegexOptions.None ));
+                       Match m = r.Match ("foobar", 1, 4);
+
+                       Assert.IsTrue (m.Success);
+                       Assert.AreEqual ("ooba", m.Value);
+               }
+
+               [Test]
+               public void Match_SubstringRtl ()
+               {
+                       Regex r = new Regex(@".*", RegexOptions.RightToLeft);
+                       Match m = r.Match("ABCDEFGHI", 2, 6);
+
+                       Assert.IsTrue (m.Success);
+                       Assert.AreEqual ("CDEFGH", m.Value);
+               }
+
                [Test, ExpectedException (typeof (ArgumentNullException))]
                public void Replace_InputNull ()
                {