Update tests

This commit is contained in:
Seiichi Uchida 2018-09-19 23:19:24 +09:00
parent 829dbfabe9
commit 594774b4e5
12 changed files with 70 additions and 36 deletions

View File

@ -38,7 +38,8 @@ fn main() {
.method_call_a(aaaaa, bbbbb, |c| {
let x = c;
x
}).method_call_b(aaaaa, bbbbb, |c| {
})
.method_call_b(aaaaa, bbbbb, |c| {
let x = c;
x
});
@ -55,7 +56,8 @@ fn main() {
body.fold(Body::new(), |mut body, chunk| {
body.extend(chunk);
Ok(body)
}).and_then(move |body| {
})
.and_then(move |body| {
let req = Request::from_parts(parts, body);
f(req).map_err(|_| io::Error::new(io::ErrorKind::Other, ""))
});
@ -64,7 +66,8 @@ fn main() {
.map(|x| {
x += 1;
x
}).filter(some_mod::some_filter)
})
.filter(some_mod::some_filter)
}
fn floaters() {
@ -76,14 +79,16 @@ fn floaters() {
let x = Foo {
field1: val1,
field2: val2,
}.method_call()
}
.method_call()
.method_call();
let y = if cond {
val1
} else {
val2
}.method_call();
}
.method_call();
{
match x {
@ -91,9 +96,10 @@ fn floaters() {
// params are 1-indexed
stack.push(
mparams[match cur.to_digit(10) {
Some(d) => d as usize - 1,
None => return Err("bad param number".to_owned()),
}].clone(),
Some(d) => d as usize - 1,
None => return Err("bad param number".to_owned()),
}]
.clone(),
);
}
}
@ -103,28 +109,34 @@ fn floaters() {
some();
} else {
none();
}.bar()
}
.bar()
.baz();
Foo {
x: val,
}.baz(|| {
}
.baz(|| {
force();
multiline();
}).quux();
})
.quux();
Foo {
y: i_am_multi_line,
z: ok,
}.baz(|| {
}
.baz(|| {
force();
multiline();
}).quux();
})
.quux();
a + match x {
true => "yay!",
false => "boo!",
}.bar()
}
.bar()
}
fn is_replaced_content() -> bool {
@ -184,7 +196,8 @@ fn issue1392() {
else {
b();
}
"#.trim(),
"#
.trim(),
);
}
@ -234,7 +247,8 @@ impl Foo {
}
}
})
}).collect();
})
.collect();
}
}
@ -247,8 +261,10 @@ fn issue2415() {
Ok((|| {
// stuff
Some(value.to_string())
})().ok_or("")?)
})().unwrap_or_else(|_: Box<::std::error::Error>| String::from(""));
})()
.ok_or("")?)
})()
.unwrap_or_else(|_: Box<::std::error::Error>| String::from(""));
}
impl issue_2786 {
@ -256,10 +272,12 @@ impl issue_2786 {
foo(|a| {
println!("a");
println!("b");
}).bar(|c| {
})
.bar(|c| {
println!("a");
println!("b");
}).baz(|c| {
})
.baz(|c| {
println!("a");
println!("b");
})
@ -271,10 +289,12 @@ fn issue_2773() {
bar.or_else(|| {
// do stuff
None
}).or_else(|| {
})
.or_else(|| {
// do other stuff
None
}).and_then(|val| {
})
.and_then(|val| {
// do this stuff
None
});

View File

@ -171,7 +171,8 @@ fn issue1329() {
.map(|x| {
x += 1;
x
}).filter
})
.filter
}
fn issue325() {

View File

@ -61,7 +61,8 @@ fn issue1420() {
# Getting started
...
"#,
).running(waltz)
)
.running(waltz)
}
// #1563
@ -117,7 +118,8 @@ impl Cursor {
debug_assert_eq!(n, -1);
None
}
}).or_else(|| {
})
.or_else(|| {
let canonical = self.canonical();
if canonical != *self {
canonical.num_template_args()

View File

@ -141,7 +141,8 @@ fn issue_1450() {
Relaxed,
Release,
Relaxed,
).is_ok()
)
.is_ok()
{
return;
}

View File

@ -4,7 +4,8 @@ fn floaters() {
let x = Foo {
field1: val1,
field2: val2,
}.method_call()
}
.method_call()
.method_call();
let y = if cond {

View File

@ -4,7 +4,8 @@ fn floaters() {
let x = Foo {
field1: val1,
field2: val2,
}.method_call()
}
.method_call()
.method_call();
let y = if cond { val1 } else { val2 }.method_call();

View File

@ -16,5 +16,6 @@ fn foo() {
Ok(entry.insert(try!(statement)))
}
}
}).map(MaybeCached::Cached)
})
.map(MaybeCached::Cached)
}

View File

@ -55,7 +55,8 @@ fn bar() {}
/// .resource("/", |r| r.f(|r| HttpResponse::Ok()))
/// .boxed(),
/// ]
/// }).bind("127.0.0.1:8080")
/// })
/// .bind("127.0.0.1:8080")
/// .unwrap()
/// .run()
/// # });

View File

@ -52,7 +52,8 @@ fn main() {
assert!(row_sum_a > 0);
(item_b, (item_a, num_cooccurrences, row_sum_a))
},
).join_map(
)
.join_map(
&row_sums,
|&item_b, &(item_a, num_cooccurrences, row_sum_a), &row_sum_b| {
assert!(row_sum_a > 0);
@ -159,5 +160,6 @@ fn main() {
worker.step();
}
}
}).unwrap();
})
.unwrap();
}

View File

@ -173,7 +173,8 @@ fn issue1739() {
..,
init_size[1] - extreeeeeeeeeeeeeeeeeeeeeeeem..init_size[1],
..
]).par_map_inplace(|el| *el = 0.);
])
.par_map_inplace(|el| *el = 0.);
}
fn issue_1885() {
@ -183,7 +184,8 @@ fn issue_1885() {
chan_select! {
rx.recv() => {}
}
}).collect::<Vec<_>>();
})
.collect::<Vec<_>>();
}
fn issue_1917() {

View File

@ -381,7 +381,8 @@ fn issue1456() {
.iter()
.map(|node| {
XPathNodeReader::new(node, &context).and_then(|r| ArtistRef::from_xml(&r))
}).collect();
})
.collect();
res?
}
_ => Vec::new(),

View File

@ -29,7 +29,8 @@ fn main() {
expr.rewrite(
inner_context,
&Constraints::new(try_opt!(v_budget.checked_sub(2)), indent + 2),
).map(|s| format!("..{}", s))
)
.map(|s| format!("..{}", s))
}
}
},