2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / System / Test / System.Text.RegularExpressions / PerlTest.cs
index f09681a91ccb55bd377764060b0c8dd2bfd9005f..82952f52f17881d6891dcf90465112b09d4b3173 100644 (file)
@@ -3,8 +3,12 @@
 // namespace:  MonoTests.System.Text.RegularExpressions\r
 // file:       PerlTest.cs\r
 //\r
-// author:     Dan Lewis (dlewis@gmx.co.uk)\r
-//             (c) 2002\r
+// Authors:    \r
+//   Dan Lewis (dlewis@gmx.co.uk)\r
+//   Martin Willemoes Hansen (mwh@sysrq.dk)\r
+//\r
+// (c) 2002 Dan Lewis\r
+// (c) 2003 Martin Willemoes Hansen\r
 \r
 using System;\r
 using System.Text.RegularExpressions;\r
@@ -13,28 +17,34 @@ using NUnit.Framework;
 \r
 namespace MonoTests.System.Text.RegularExpressions {\r
        \r
-       public class PerlTest : TestCase {\r
-               public static ITest Suite {\r
-                       get { return new TestSuite (typeof (PerlTest)); }\r
-               }\r
-\r
-               public PerlTest () : this ("System.Text.RegularExpressions Perl testsuite") { }\r
-               public PerlTest (string name) : base (name) { }\r
+       \r
+       [TestFixture]\r
+       public class PerlTest {\r
 \r
-               public void TestTrials () {\r
+               [Test]\r
+               public void Trials () {\r
+                       string msg = "";\r
                        foreach (RegexTrial trial in PerlTrials.trials) {\r
                                string actual = trial.Execute ();\r
                                if (actual != trial.Expected) {\r
-                                       Assertion.Fail (\r
-                                               trial.ToString () +\r
+                                       msg += "\t" + trial.ToString () +\r
                                                "Expected " + trial.Expected +\r
-                                               " but got " + actual\r
-                                       );\r
+                                               " but got " + actual + "\n";\r
+                                               \r
+                                       if ( trial.Error != "" ) \r
+                                               msg += "\n" + trial.Error;\r
+\r
+                                               \r
+                                       //Assertion.Fail (\r
+                                       //      trial.ToString () +\r
+                                       //      "Expected " + trial.Expected +\r
+                                       //      " but got " + actual\r
+                                       //);\r
                                }\r
                        }\r
+                       if (msg != "" ) \r
+                               Assertion.Fail("\n" + msg);\r
                }\r
-\r
-               protected override void SetUp () { }\r
-               protected override void TearDown () { }\r
        }\r
 }\r
+\r