Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a hint about what to try first when regexp tests are failing #425

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions test/Esprima.Tests/RegExpTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,9 @@ public static IEnumerable<object[]> TestCases(string relativePath)
[MemberData(nameof(TestCases), "Fixtures.RegExp")]
public void ExecuteTestCase(string pattern, string flags, string expectedAdaptedPattern, string testString, string expectedMatchesJson, string hints)
{
// When upgrading .NET runtime version, it's expected that some of the tests may fail because the regexp rewriting logic
// uses some Unicode-related APIs provided by .NET and the underlying Unicode datasets may be updated between .NET versions.
// So, in the case of failing tests, try to re-generate the test cases first.
// To re-generate test cases, execute `dotnet run --project Fixtures.RegExp\Generator -c Release`

static string DecodeStringIfEscaped(string value) => JavaScriptStringHelper.IsStringLiteral(value)
Expand Down