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

Allow for return types #4

Merged
merged 3 commits into from
Mar 2, 2024
Merged

Allow for return types #4

merged 3 commits into from
Mar 2, 2024

Conversation

dzfrias
Copy link
Contributor

@dzfrias dzfrias commented Feb 14, 2024

Thanks for the great crate! This PR allows return types in test functions (namely for Result<T>).

Copy link
Collaborator

@Y-Nak Y-Nak left a comment

Choose a reason for hiding this comment

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

Thanks for this PR! The change looks good to me.
Would you modify a doc comment in dir-test/src/lib.rs so users can know this nice feature?

@Y-Nak
Copy link
Collaborator

Y-Nak commented Mar 2, 2024

Oh, no. I just remembered that rust doesn't allow the return type in the #[test] function.
Would you share the use case for it? We could easily extend this crate to generate a normal function which one-to-one corresponds to a file.

@dzfrias
Copy link
Contributor Author

dzfrias commented Mar 2, 2024

Rust allows for the Result type to be used in the return type of a test: link here. If the change is still okay, I'll add that doc comment!

@Y-Nak
Copy link
Collaborator

Y-Nak commented Mar 2, 2024

Ah, I'm embarrassed! I didn't know it's just required to implement std::process::Termination for the return type.

Alright, your change looks good to me! Thanks!

@dzfrias
Copy link
Contributor Author

dzfrias commented Mar 2, 2024

Okay, I added the relevant documentation!

@Y-Nak Y-Nak merged commit dceb0e4 into fe-lang:main Mar 2, 2024
5 checks passed
@Y-Nak
Copy link
Collaborator

Y-Nak commented Mar 2, 2024

Thank you! I'll bump up the version.

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.

2 participants