PerlTest.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // assembly: System_test
  3. // namespace: MonoTests.System.Text.RegularExpressions
  4. // file: PerlTest.cs
  5. //
  6. // Authors:
  7. // Dan Lewis ([email protected])
  8. // Martin Willemoes Hansen ([email protected])
  9. //
  10. // (c) 2002 Dan Lewis
  11. // (c) 2003 Martin Willemoes Hansen
  12. using System;
  13. using System.Text.RegularExpressions;
  14. using NUnit.Framework;
  15. namespace MonoTests.System.Text.RegularExpressions {
  16. [TestFixture]
  17. public class PerlTest {
  18. [Test]
  19. public void Trials () {
  20. string msg = "";
  21. foreach (RegexTrial trial in PerlTrials.trials) {
  22. string actual = trial.Execute ();
  23. if (actual != trial.Expected) {
  24. msg += "\t" + trial.ToString () +
  25. "Expected " + trial.Expected +
  26. " but got " + actual + "\n";
  27. if ( trial.Error != "" )
  28. msg += "\n" + trial.Error;
  29. //Assertion.Fail (
  30. // trial.ToString () +
  31. // "Expected " + trial.Expected +
  32. // " but got " + actual
  33. //);
  34. }
  35. }
  36. if (msg != "" )
  37. Assertion.Fail("\n" + msg);
  38. }
  39. }
  40. }