@@ -59,6 +59,9 @@ protected BaseTestBaseline(ITestOutputHelper output) : base(output)
59
59
private const string OutputRootUnixRegExp = @"\/[^\\\t ]+\/TestOutput" + @"\/[^\\\t ]+" ;
60
60
private static readonly string BinRegUnixExp = @"\/[^\\\t ]+\/bin\/" + Mode ;
61
61
private static readonly string Bin64RegUnixExp = @"\/[^\\\t ]+\/bin\/x64\/" + Mode ;
62
+ // The Regex matches both positive and negative decimal point numbers present in a string.
63
+ // The numbers could be a part of a word. They can also be in Exponential form eg. 3E-9
64
+ private static readonly Regex MatchNumbers = new Regex ( @"-?\b[0-9]+\.?[0-9]*(E-[0-9]*)?\b" , RegexOptions . IgnoreCase | RegexOptions . Compiled ) ;
62
65
63
66
/// <summary>
64
67
/// When the progress log is appended to the end of output (in test runs), this line precedes the progress log.
@@ -506,16 +509,14 @@ protected bool CheckEqualityFromPathsCore(string relPath, string basePath, strin
506
509
507
510
private void GetNumbersFromFile ( ref string firstString , ref string secondString , int digitsOfPrecision )
508
511
{
509
- // The Regex matches both positive and negative decimal point numbers present in a string.
510
- // The numbers could be a part of a word. They can also be in Exponential form eg. 3E-9
511
- Regex _matchNumer = new Regex ( @"-?\b[0-9]+\.?[0-9]*(E-[0-9]*)?\b" , RegexOptions . IgnoreCase | RegexOptions . Compiled ) ;
512
- MatchCollection firstCollection = _matchNumer . Matches ( firstString ) ;
513
- MatchCollection secondCollection = _matchNumer . Matches ( secondString ) ;
512
+
513
+ MatchCollection firstCollection = MatchNumbers . Matches ( firstString ) ;
514
+ MatchCollection secondCollection = MatchNumbers . Matches ( secondString ) ;
514
515
515
516
if ( firstCollection . Count == secondCollection . Count )
516
517
MatchNumberWithTolerance ( firstCollection , secondCollection , digitsOfPrecision ) ;
517
- firstString = _matchNumer . Replace ( firstString , "%Number%" ) ;
518
- secondString = _matchNumer . Replace ( secondString , "%Number%" ) ;
518
+ firstString = MatchNumbers . Replace ( firstString , "%Number%" ) ;
519
+ secondString = MatchNumbers . Replace ( secondString , "%Number%" ) ;
519
520
}
520
521
521
522
private void MatchNumberWithTolerance ( MatchCollection firstCollection , MatchCollection secondCollection , int digitsOfPrecision )
0 commit comments