mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-18 12:31:30 -10:00
* PerlTrials.cs : Added many test for RightToLeft * PerlTest.cs, RegexTrial : Modified version of regextrial to be run all the test and to report exception. svn path=/trunk/mcs/; revision=24248
51 lines
1.0 KiB
C#
51 lines
1.0 KiB
C#
//
|
|
// assembly: System_test
|
|
// namespace: MonoTests.System.Text.RegularExpressions
|
|
// file: PerlTest.cs
|
|
//
|
|
// Authors:
|
|
// Dan Lewis ([email protected])
|
|
// Martin Willemoes Hansen ([email protected])
|
|
//
|
|
// (c) 2002 Dan Lewis
|
|
// (c) 2003 Martin Willemoes Hansen
|
|
|
|
using System;
|
|
using System.Text.RegularExpressions;
|
|
|
|
using NUnit.Framework;
|
|
|
|
namespace MonoTests.System.Text.RegularExpressions {
|
|
|
|
|
|
[TestFixture]
|
|
public class PerlTest {
|
|
|
|
[Test]
|
|
public void Trials () {
|
|
string msg = "";
|
|
foreach (RegexTrial trial in PerlTrials.trials) {
|
|
string actual = trial.Execute ();
|
|
if (actual != trial.Expected) {
|
|
msg += "\t" + trial.ToString () +
|
|
"Expected " + trial.Expected +
|
|
" but got " + actual + "\n";
|
|
|
|
if ( trial.Error != "" )
|
|
msg += "\n" + trial.Error;
|
|
|
|
|
|
//Assertion.Fail (
|
|
// trial.ToString () +
|
|
// "Expected " + trial.Expected +
|
|
// " but got " + actual
|
|
//);
|
|
}
|
|
}
|
|
if (msg != "" )
|
|
Assertion.Fail("\n" + msg);
|
|
}
|
|
}
|
|
}
|
|
|