This commit was manufactured by cvs2svn to create branch 'mono-1-0'.
[mono.git] / mcs / class / System / Test / System.Text.RegularExpressions / PerlTest.cs
1 //\r
2 // assembly:    System_test\r
3 // namespace:   MonoTests.System.Text.RegularExpressions\r
4 // file:        PerlTest.cs\r
5 //\r
6 // Authors:     \r
7 //   Dan Lewis (dlewis@gmx.co.uk)\r
8 //   Martin Willemoes Hansen (mwh@sysrq.dk)\r
9 //\r
10 // (c) 2002 Dan Lewis\r
11 // (c) 2003 Martin Willemoes Hansen\r
12 \r
13 using System;\r
14 using System.Text.RegularExpressions;\r
15 \r
16 using NUnit.Framework;\r
17 \r
18 namespace MonoTests.System.Text.RegularExpressions {\r
19         \r
20        \r
21         [TestFixture]\r
22         public class PerlTest {\r
23 \r
24                 [Test]\r
25                 public void Trials () {\r
26                         string msg = "";\r
27                         foreach (RegexTrial trial in PerlTrials.trials) {\r
28                                 string actual = trial.Execute ();\r
29                                 if (actual != trial.Expected) {\r
30                                         msg += "\t" + trial.ToString () +\r
31                                                 "Expected " + trial.Expected +\r
32                                                 " but got " + actual + "\n";\r
33                                                 \r
34                                         if ( trial.Error != "" ) \r
35                                                 msg += "\n" + trial.Error;\r
36 \r
37                                                 \r
38                                         //Assertion.Fail (\r
39                                         //      trial.ToString () +\r
40                                         //      "Expected " + trial.Expected +\r
41                                         //      " but got " + actual\r
42                                         //);\r
43                                 }\r
44                         }\r
45                         if (msg != "" ) \r
46                                 Assertion.Fail("\n" + msg);\r
47                 }\r
48         }\r
49 }\r
50 \r