Skip to content

Commit

Permalink
Enabling some tests back onto the Interpreted engine (dotnet#72639)
Browse files Browse the repository at this point in the history
  • Loading branch information
joperezr authored Jul 26, 2022
1 parent 33d033d commit cb046e5
Showing 1 changed file with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -387,18 +387,29 @@ public static IEnumerable<object[]> Matches_TestData()
}

#if !NETFRAMEWORK // these tests currently fail on .NET Framework, and we need to check IsDynamicCodeCompiled but that doesn't exist on .NET Framework
if (engine != RegexEngine.Interpreter && // these tests currently fail with RegexInterpreter
RuntimeFeature.IsDynamicCodeCompiled) // if dynamic code isn't compiled, RegexOptions.Compiled falls back to the interpreter, for which these tests currently fail

yield return new object[]
{
engine, "@(a*)+?", "@", RegexOptions.None, new[]
{
new CaptureData("@", 0, 1)
}
};

if (!RegexHelpers.IsNonBacktracking(engine)) // atomic subexpressions aren't supported
{
// Fails on interpreter and .NET Framework: [ActiveIssue("https://github.com/dotnet/runtime/issues/62094")]
yield return new object[]
{
engine, "@(a*)+?", "@", RegexOptions.None, new[]
engine, @"()(?>\1+?).\b", "xxxx", RegexOptions.None, new[]
{
new CaptureData("@", 0, 1)
new CaptureData("x", 3, 1),
}
};
}

if (engine != RegexEngine.Interpreter && // these tests currently fail with RegexInterpreter
RuntimeFeature.IsDynamicCodeCompiled) // if dynamic code isn't compiled, RegexOptions.Compiled falls back to the interpreter, for which these tests currently fail
{
// Fails on interpreter and .NET Framework: [ActiveIssue("https://github.com/dotnet/runtime/issues/62094")]
yield return new object[]
{
Expand All @@ -408,18 +419,6 @@ public static IEnumerable<object[]> Matches_TestData()
new CaptureData("", 1, 0)
}
};

if (!RegexHelpers.IsNonBacktracking(engine)) // atomic subexpressions aren't supported
{
// Fails on interpreter and .NET Framework: [ActiveIssue("https://github.com/dotnet/runtime/issues/62094")]
yield return new object[]
{
engine, @"()(?>\1+?).\b", "xxxx", RegexOptions.None, new[]
{
new CaptureData("x", 3, 1),
}
};
}
}
#endif
}
Expand Down

0 comments on commit cb046e5

Please sign in to comment.