Skip to content

proptest_path in attr macro#635

Draft
cameron1024 wants to merge 6 commits intomainfrom
macro-proptest-path
Draft

proptest_path in attr macro#635
cameron1024 wants to merge 6 commits intomainfrom
macro-proptest-path

Conversation

@cameron1024
Copy link
Member

Adds an argument to the attribute macro proptest_path = "some::path::to::proptest", which changes where the macro assumes it can find the proptest crate. I.e., if you provide proptest_path = "some::path::to::proptest, the macro will emit:

impl some::path::to::proptest::prelude::Arbitrary for ... {}

Motivation

At Zed, we have a custom test macro that injects some special arguments, and provides a limited form of property testing. I am improving this macro by using proptest instead of uniformly sampling from a distribution, but the current macro assumes that ::proptest will always be accessible. Adding this parameter allows the gpui::test macro to expand to #[gpui::proptest::property_test(proptest_path = "gpui::proptest") fn ..., which removes the need to add proptest as a dependency in every crate that wants to write a test.

cameron1024 and others added 6 commits March 5, 2026 17:14
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.

1 participant