Skip to content

Opt args that take default value when skipped#327

Draft
Atreyagaurav wants to merge 3 commits into
la10736:masterfrom
Atreyagaurav:opt-args
Draft

Opt args that take default value when skipped#327
Atreyagaurav wants to merge 3 commits into
la10736:masterfrom
Atreyagaurav:opt-args

Conversation

@Atreyagaurav
Copy link
Copy Markdown

Fixes #325

  • a global #[default] attribute to enable the feature on the test function and all arguments are considered optional and use default
  • if some argument have also the #[case(opt)] we wrap it with Some() if present and None otherwise
  • Raise error if some arguments are optional, but the global default is not present.

@Atreyagaurav
Copy link
Copy Markdown
Author

Please refer to the integration tests for how to use it. And suggest any improvements I should do on this implementation.

I need more time to think about implementing the case(opt) for individual args.

Aside: It'd be nice if we could give values from case() with key = value, that way we could omit values irrespective of their locations, but that seems more trouble than worth it at the moment.

@la10736
Copy link
Copy Markdown
Owner

la10736 commented Oct 5, 2025

Thanks for your contribution. I'll review you PR ASAM... but I'm quite busy in these days.

@Atreyagaurav
Copy link
Copy Markdown
Author

Atreyagaurav commented Oct 5, 2025

No worries, I'm still working on the last two, so you don't need to do a thorough review. Just letting me know if I'm on the right track is enough for now. Whenever you can is fine.

@la10736
Copy link
Copy Markdown
Owner

la10736 commented Nov 11, 2025

Sorry for my late answer. I're going in the right direction!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Optional values in #[case..]

2 participants