-
Notifications
You must be signed in to change notification settings - Fork 5
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
Some tests for user-defined meta rules that accept some PEGs as arguments. #14
Conversation
WalkthroughIn this update, several GitHub workflow files and source code are modified to improve continuous integration (CI) and code benchmarking processes, enhance code documentation, and introduce new testing functionality. Benchmarking is now run on all branches, workflow steps are refined for consistency, code coverage visualization is enhanced, explanations in Changes
Sequence Diagram(s)Skipping this section as the changes are varied and do not include a new feature or significant modifications to control flow in a unified manner. Poem
🐇✨ Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- .github/workflows/benchmark.yml (1 hunks)
- .github/workflows/ci.yml (2 hunks)
- codedov.yml (1 hunks)
- derive/src/lib.rs (1 hunks)
- derive/tests/meta_rules.rs (1 hunks)
Files skipped from review due to trivial changes (4)
- .github/workflows/benchmark.yml
- .github/workflows/ci.yml
- codedov.yml
- derive/src/lib.rs
Additional comments not posted (3)
derive/tests/meta_rules.rs (3)
7-13
: Define a custom parser with user-defined meta rules.The parser definition using
pest3
andpest3_derive
with inline grammar looks correct and effectively utilizes PEGs to define complex parsing rules. This setup follows best practices for defining concise and readable grammars.
15-27
: Implement a function to convert input strings into JSON arrays.The function
to_json
correctly implements the parsing logic using thepest3
library. The use of iterators and chaining methods enhances the readability and efficiency of the code. Good error handling withResult
return type.
29-42
: Extensive testing of the custom parser functionality.The test cases are well-constructed and cover a variety of scenarios, including success cases and expected failures. This thorough testing ensures the robustness of the parser functionality.
This adds some tests about meta rules. Currently only meta rules that accept PEGs can be defined by users, and users can't define a rule that accepts a slice (like
pest::stack::peek
).An example that is tested:
This solves a part of #8.
And this PR includes some updates about CI, as previous PR doesn't actually enable benchmarking correctly.
Summary by CodeRabbit
Chores
Documentation
Tests
pest3
to convert input strings into JSON arrays.