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

Ruby 3.1: Add specs for require objspace/trace #989

Merged
merged 1 commit into from
Jan 4, 2023

Conversation

ytjmt
Copy link
Contributor

@ytjmt ytjmt commented Jan 4, 2023

Add specs for Feature #17762

Ref:

  • Write specs for new Ruby 3.1 features and changes #923
    • Miscellaneous changes

      • ib/objspace/trace.rb is added, which is a tool for tracing the object allocation. Just by requiring this file, tracing is started immediately. Just by Kernel#p, you can investigate where an object was created. Note that just requiring this file brings a large performance overhead. This is only for debugging purposes. Do not use this in production. [Feature #17762]

  • ruby/ruby@cf1e187

@ytjmt ytjmt force-pushed the add-objspace-trace-spec branch from ee33456 to e66f702 Compare January 4, 2023 14:35
@eregon
Copy link
Member

eregon commented Jan 4, 2023

Could you use a fixture file (see fixture() helper and fixtures folders)? That way the path is stable and can also be tested in the output.

@ytjmt ytjmt force-pushed the add-objspace-trace-spec branch from e66f702 to ae927e5 Compare January 4, 2023 15:25
@ytjmt
Copy link
Contributor Author

ytjmt commented Jan 4, 2023

Copy link
Member

@eregon eregon left a comment

Choose a reason for hiding this comment

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

Thank you for the spec!

"\"foo\" @ #{file}:2",
"\"bar\" @ #{file}:3",
"42"
]
Copy link
Member

Choose a reason for hiding this comment

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

Minor: this could be a heredoc and then no need to escape or split by line or so

@eregon eregon merged commit 4714033 into ruby:master Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants