-
Notifications
You must be signed in to change notification settings - Fork 1
Add parse function to Rust RBS bindings #53
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
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
rust/ruby-rbs/src/lib.rs
Outdated
| } | ||
|
|
||
| #[test] | ||
| fn test_rbs_string_new() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we need this test or if we should keep all of our testing at the parser integration level. My gut feeling is that we could just test all of our Rust structures through the result of parsing RBS code and avoid manually instantiating anything.
What do you think? Do you think we lose any guarantees if we test everything through the parser?
c0cf31d to
a6b528d
Compare
91a4364 to
2320c10
Compare
Implement the parse function that enables parsing RBS code from Rust. This provides a safe Rust interface to the C parser, handling memory management and encoding setup.
2320c10 to
734389f
Compare
The `parse` function enables parsing RBS code from Rust. This provides a safe Rust interface to the C parser, handling memory management and encoding setup.
The `parse` function enables parsing RBS code from Rust. This provides a safe Rust interface to the C parser, handling memory management and encoding setup.
The `parse` function enables parsing RBS code from Rust. This provides a safe Rust interface to the C parser, handling memory management and encoding setup.

This PR originally was testing
RBSStringby manually instantiating it and verifying its methods. Now it adds aparsefunction that enables testing our Rust structures through the parser integration level, following the review feedback that parser integration tests will cover everything we need without requiring separate unit tests.The
parsefunction provides a safe Rust interface to the C parser. While we can't yet access parsed AST fields to fully verify string translation (requires more bindings), this establishes the foundation for parser-based testing going forward.