Open foresterre opened 4 years ago
Another way is to allow specifying #[test]
after #[parameterized(..)]
(by making parameterized
macro to remove #[test]
):
#[parameterized(
a = { 1, 2, 3 },
b = { 5, 6, 7},
)]
#[test]
fn le_test(a: i32, b: i32) {
assert!(a < 4 && b > 4);
}
Which is non-ideal (you can only put it after #[parameterized(..)
), but works okay (this is how we do it in datatest).
Another way is to allow specifying
#[test]
after#[parameterized(..)]
(by makingparameterized
macro to remove#[test]
):#[parameterized( a = { 1, 2, 3 }, b = { 5, 6, 7}, )] #[test] fn le_test(a: i32, b: i32) { assert!(a < 4 && b > 4); }
Which is non-ideal (you can only put it after
#[parameterized(..)
), but works okay (this is how we do it in datatest).
Oh wow :), that's a great idea. Thank you! I will look into this.
declarative macro for which wraps ide! construct, test inputs and test cases