Skip to content

Commit dcffd8d

Browse files
committed
Fix tests on mono interpreter
1 parent 350c756 commit dcffd8d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/libraries/System.Text.RegularExpressions/tests/Regex.MultipleMatches.Tests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Threading.Tasks;
66
using Xunit;
77
using System.Linq;
8+
using System.Runtime.CompilerServices;
89

910
namespace System.Text.RegularExpressions.Tests
1011
{
@@ -327,7 +328,9 @@ public static IEnumerable<object[]> Matches_TestData()
327328
}
328329
}
329330

330-
if (engine != RegexEngine.Interpreter && !PlatformDetection.IsNetFramework)
331+
#if !NETFRAMEWORK // these tests currently fail on .NET Framework, and we need to check IsDynamicCodeCompiled but that doesn't exist on .NET Framework
332+
if (engine != RegexEngine.Interpreter && // these tests currently fail with RegexInterpreter
333+
RuntimeFeature.IsDynamicCodeCompiled) // if dynamic code isn't compiled, RegexOptions.Compiled falls back to the interpreter, for which these tests currently fail
331334
{
332335
// Fails on interpreter and .NET Framework: [ActiveIssue("https://github.com/dotnet/runtime/issues/62094")]
333336
yield return new object[]
@@ -360,6 +363,7 @@ public static IEnumerable<object[]> Matches_TestData()
360363
};
361364
}
362365
}
366+
#endif
363367
}
364368
}
365369

0 commit comments

Comments
 (0)