Skip to content

[lldb] Fix regex in TestSwiftTaskSyntheticProvider #10307

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

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
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_top_level_task(self):
patterns=[
textwrap.dedent(
r"""
\(Task<\(\), Error>\) task = id:(\d+) flags:(?:running\|)?enqueued\|future \{
\(Task<\(\), Error>\) task = id:(\d+) flags:(?:running\|)?(?:enqueued\|)?future \{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I'm still confused by this regex.
Why is the | part of the group?
What if enqueued is the last attribute?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. the flags are in a fixed order, enqueued will be after running (by design)
  2. the flags are | separated, and if enqueued is present, then it will be followed by the |

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I plan to revisit these tests. This change (llvm#131475) is one of the pieces I'm working on in spare time be able to structure these tests with more easy to read regex.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah.. because future is always there. Makes sense.

address = 0x[0-9a-f]+
id = \1
enqueuePriority = \.medium
Expand All @@ -45,7 +45,7 @@ def test_current_task(self):
patterns=[
textwrap.dedent(
r"""
\(UnsafeCurrentTask\) currentTask = id:(\d+) flags:(?:running\|)?asyncLetTask|childTask|future \{
\(UnsafeCurrentTask\) currentTask = id:(\d+) flags:(?:running\|)?(?:enqueued\|)?asyncLetTask|childTask|future \{
address = 0x[0-9a-f]+
id = \1
enqueuePriority = \.medium
Expand Down