-
Notifications
You must be signed in to change notification settings - Fork 40
Iterable args: a way to expand a given argument of test_matrix #142
Copy link
Copy link
Open
Description
I'd like to be able to
fn things() -> Vec<T> { .. }
#[test_matrix([false,true], things())]
fn my_func(a: bool, b: T) { .. } (meaning: expand things() into its values, like the literal list to the left).
Today this doesn't compile, saying that b's type doesn't match things() (and that's expected).
How do you think this can be solved?
- should we allow this IFF
things()returnsimpl IntoIterator<Item = T>? - should we allow a modifier on arguments to mark these to interpret as iterators?
#[test_matrix([false,true], from: things())]
fn my_func(a: bool, b: T) { .. } // How about a prelude providing say `iter(..)`
#[test_matrix([false,true], iter(things()))]
fn my_func(a: bool, b: T) { .. } - is there a
constrestriction onthings()?
BTW could you merge test_matrix's wiki this repo's? There's a new page as well as other modifications
#128 (comment)
Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels