Skip to content

Commit

Permalink
Avoid needlessly complex macro
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhoo committed Jun 20, 2017
1 parent a59add3 commit c4a326c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1302,12 +1302,12 @@ mod tests {
use tokio_core::reactor::Core;

macro_rules! tester {
($c:ident, $f:expr) => {{
($f:ident) => {{
let mut core = Core::new().unwrap();
let h = core.handle();
let $c = core.run(Client::new("http://localhost:4444", &h))
let c = core.run(Client::new("http://localhost:4444", &h))
.expect("failed to construct test client");
core.run($f)
core.run($f(&c))
.expect("test produced unexpected error response");
}}
}
Expand Down Expand Up @@ -1336,7 +1336,7 @@ mod tests {

#[test]
fn it_works() {
tester!(c, works_inner(&c))
tester!(works_inner)
}

fn clicks_inner<'a>(c: &'a Client) -> impl Future<Item = (), Error = error::CmdError> + 'a {
Expand All @@ -1358,7 +1358,7 @@ mod tests {

#[test]
fn it_clicks() {
tester!(c, clicks_inner(&c))
tester!(clicks_inner)
}

fn raw_inner<'a>(c: &'a Client) -> impl Future<Item = (), Error = error::CmdError> + 'a {
Expand Down Expand Up @@ -1397,6 +1397,6 @@ mod tests {

#[test]
fn it_can_be_raw() {
tester!(c, raw_inner(&c))
tester!(raw_inner)
}
}

0 comments on commit c4a326c

Please sign in to comment.