Check in up-to-date version of RegexTest.cs. Somehow the previous
authorRaja R Harinath <harinath@hurrynot.org>
Tue, 8 Sep 2009 15:12:38 +0000 (15:12 -0000)
committerRaja R Harinath <harinath@hurrynot.org>
Tue, 8 Sep 2009 15:12:38 +0000 (15:12 -0000)
checkin got an untested preliminary version

svn path=/trunk/mcs/; revision=141530

mcs/class/System/Test/System.Text.RegularExpressions/RegexTest.cs

index 1d593d50059e9369aea6de4e1a0d84f6cbd97812..83924890e4b90468369d22b7824cf7fe843d81ef 100644 (file)
@@ -222,13 +222,15 @@ namespace MonoTests.System.Text.RegularExpressions
                [Test, ExpectedException (typeof (ArgumentOutOfRangeException))]
                public void Replace_InvalidCount ()
                {
-                       Regex.Replace ("foo", "foo|bar", "baz", -4);
+                       Regex r = new Regex ("foo|bar");
+                       r.Replace ("foo",  "baz", -4);
                }
 
                [Test, ExpectedException (typeof (ArgumentOutOfRangeException))]
                public void Replace_InvalidStart ()
                {
-                       Regex.Replace ("foo", "foo|bar", "baz", 1, -4);
+                       Regex r = new Regex ("foo|bar");
+                       r.Replace ("foo", "baz", 1, -4);
                }
 
                [Test, ExpectedException (typeof (ArgumentNullException))]
@@ -243,16 +245,18 @@ namespace MonoTests.System.Text.RegularExpressions
                        Regex.Split (null, "^.*$", RegexOptions.RightToLeft);
                }
 
-               [Test, ExpectedException (typeof (ArgumentNullException))]
+               [Test, ExpectedException (typeof (ArgumentOutOfRangeException))]
                public void Split_InvalidCount ()
                {
-                       Regex.Split (null, "^.*$", -4);
+                       Regex r = new Regex ("^.*$");
+                       r.Split ("foo", -4);
                }
 
-               [Test, ExpectedException (typeof (ArgumentNullException))]
+               [Test, ExpectedException (typeof (ArgumentOutOfRangeException))]
                public void Split_InvalidCount2 ()
                {
-                       Regex.Split (null, "^.*$", 1, -4);
+                       Regex r = new Regex ("^.*$");
+                       r.Split ("foo", 1, -4);
                }
 
                [Test, ExpectedException (typeof (ArgumentNullException))]