Skip to content

fix: adapt to changes in macro parsing #43

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

Merged
merged 1 commit into from
Dec 19, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions src/arbitrary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ impl<A: Arbitrary, B: Arbitrary> Arbitrary for Result<A, B> {
}
}

macro_rules! impl_arb_for_tuple(
macro_rules! impl_arb_for_tuple {
(($var_a:ident, $type_a:ident) $(, ($var_n:ident, $type_n:ident))*) => (
impl<$type_a: Arbitrary, $($type_n: Arbitrary),*> Arbitrary for ($type_a, $($type_n),*) {
fn arbitrary<GEN: Gen>(g: &mut GEN) -> ($type_a, $($type_n),*) {
Expand Down Expand Up @@ -200,26 +200,26 @@ macro_rules! impl_arb_for_tuple(
}
}
);
)

impl_arb_for_tuple!((a, A))
impl_arb_for_tuple!((a, A), (b, B))
impl_arb_for_tuple!((a, A), (b, B), (c, C))
impl_arb_for_tuple!((a, A), (b, B), (c, C), (d, D))
impl_arb_for_tuple!((a, A), (b, B), (c, C), (d, D), (e, E))
impl_arb_for_tuple!((a, A), (b, B), (c, C), (d, D), (e, E), (f, F))
}

impl_arb_for_tuple!((a, A));
impl_arb_for_tuple!((a, A), (b, B));
impl_arb_for_tuple!((a, A), (b, B), (c, C));
impl_arb_for_tuple!((a, A), (b, B), (c, C), (d, D));
impl_arb_for_tuple!((a, A), (b, B), (c, C), (d, D), (e, E));
impl_arb_for_tuple!((a, A), (b, B), (c, C), (d, D), (e, E), (f, F));
impl_arb_for_tuple!((a, A), (b, B), (c, C), (d, D), (e, E), (f, F),
(g, G))
(g, G));
impl_arb_for_tuple!((a, A), (b, B), (c, C), (d, D), (e, E), (f, F),
(g, G), (h, H))
(g, G), (h, H));
impl_arb_for_tuple!((a, A), (b, B), (c, C), (d, D), (e, E), (f, F),
(g, G), (h, H), (i, I))
(g, G), (h, H), (i, I));
impl_arb_for_tuple!((a, A), (b, B), (c, C), (d, D), (e, E), (f, F),
(g, G), (h, H), (i, I), (j, J))
(g, G), (h, H), (i, I), (j, J));
impl_arb_for_tuple!((a, A), (b, B), (c, C), (d, D), (e, E), (f, F),
(g, G), (h, H), (i, I), (j, J), (k, K))
(g, G), (h, H), (i, I), (j, J), (k, K));
impl_arb_for_tuple!((a, A), (b, B), (c, C), (d, D), (e, E), (f, F),
(g, G), (h, H), (i, I), (j, J), (k, K), (l, L))
(g, G), (h, H), (i, I), (j, J), (k, K), (l, L));

impl<A: Arbitrary> Arbitrary for Vec<A> {
fn arbitrary<G: Gen>(g: &mut G) -> Vec<A> {
Expand Down
4 changes: 2 additions & 2 deletions src/tester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ trait Fun<A, B, C, D, T> {
where G: Gen;
}

macro_rules! impl_fun_call(
macro_rules! impl_fun_call {
($f:expr, $g:expr, $($name:ident,)+) => ({
let ($($name,)*) = ($($name.unwrap(),)*);
let f = $f;
Expand All @@ -313,7 +313,7 @@ macro_rules! impl_fun_call(
}
r
});
)
}

impl<A, B, C, D, T> Fun<A, B, C, D, T> for fn() -> T
where A: AShow, B: AShow, C: AShow, D: AShow, T: Testable {
Expand Down